Android手机卫士的第二天
2012-07-27 20:31
260 查看
1、设置Activity跳转时候的样式:overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);这里也可以设置动画的其他效果。
2、自定义空间的获取控件id的情况if (isSetup()) {// 设置完成的向导界面setContentView(R.layout.lost_protect);tv_lost_protect_number = (TextView) findViewById(R.id.tv_lost_protect_number);String num = sp.getString("number", "");tv_lost_protect_number.setText(num);cb_lost_protect_status = (CheckBox) findViewById(R.id.cb_lost_protect_status);boolean ischecked = sp.getBoolean("protecting", true);if (ischecked) {cb_lost_protect_status.setText("防盗保护开启");cb_lost_protect_status.setChecked(true);} else {cb_lost_protect_status.setText("防盗保护没有开启");cb_lost_protect_status.setChecked(false);}// 重新进入设置向导tv_lost_protect_reentry_setup = (TextView) findViewById(R.id.tv_lost_protect_reentry_setup);tv_lost_protect_reentry_setup.setOnClickListener(this);} else {Intent intent = new Intent(LostProtectedActivity.this,SetupActivity1.class);startActivity(intent);}3、Android SDK中,在data\res\Drawable下有资源文件,这些资源文件打包到Android.jar中,可以直接使用这些jar包。好处:这些素材的id的引用一经默认的生成好了。可以减少当前的apk的体积。要使用Androidjar包中的东西 @Android4、重点:在广播接受者中如何启动一个activity:
public class LostProtectReciver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {String number =getResultData();if("1008612".equals(number)){Intent newIntent = new Intent(context,LostProtectedActivity.class);//如果在广播接受者中启动一个新的act,则需要告诉系统启动一个新的任务栈newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);context.startActivity(newIntent);setResultData(null);}}}
相关文章推荐
- Android项目实战--手机卫士12--手机号码归属地查询界面
- Android项目实战--手机卫士18--读取用户的短信内容以及短信备份
- Android 手机卫士--是否有密码区分对话框类型
- Android 手机卫士--设置密码对话框
- Android 手机卫士--自定义控件(获取焦点的TextView)
- [android] 手机卫士黑名单功能(ListView优化)
- [android] 手机卫士绑定sim卡
- Android项目实战--手机卫士33--ExpandableListView的使用
- Android项目实战--手机卫士22--卸载和分享功能的完成以及用户及系统应用的切换
- Android项目实战--手机卫士24--程序锁的实现以及逻辑
- [android] 手机卫士接收短信指令执行相应操作
- 浅析Android手机卫士接收短信指令执行相应操作
- android手机卫士——3、使用gridview生成程序主页面
- [android] 手机卫士关闭自动更新
- 全面认识Android手机(MIUI ROM适配之旅第二天——准备工作)
- Android 手机卫士--安装过程中点击回退按钮
- Android手机卫士之获取联系人信息显示与回显
- 全面认识Android手机(MIUI ROM适配之旅第二天——准备工作)
- Android项目实战--手机卫士20--拿到已经安装了的程序以及程序管理主界面
- [android] 手机卫士黑名单功能(ListView结合SQLite增删改)