android 用Luncher启动应用的方式
来源:互联网 发布:给大一新生的建议知乎 编辑:程序博客网 时间:2024/05/20 08:22
在做展讯平台的时候遇到四叶草锁屏,下滑可以快速进入拍照应用,经调试发现每次打开都是新的activity,并没有还原之前锁屏之前相机的状态,通过代码跟踪和调试发现,与Intent设置启动参数有关,改动点见文中fix begin和fix end 标志:
public void onTrigger(View v, Intent intent) {if(mCallback!=null){Log.d("cara","onTrigger mCallback="+mCallback); mCallback.pokeWakelock();mStatus1.setVisibility(View.GONE); mStatus2.setVisibility(View.GONE); mDragHint.setVisibility(View.VISIBLE); mIntent = null;if(intent != null){mIntent = new Intent(intent);//fix beginmIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);mIntent.addCategory(Intent.CATEGORY_LAUNCHER);//fix endmContext.startActivity(mIntent);} mHandler.postDelayed(new Runnable() {public void run() {if(mCallback!= null)mCallback.goToUnlockScreen();}}, 250); }}
onTrigger函数是每次滑动到屏幕到一个解锁位置(比如滑动到相机应用或者滑动到解锁点的时候)会触发这个函数
Intent设置这样的参数后就相当于从Launcher里面进入应用了,可以完美的还原相机应用之前的状态。
- android 用Luncher启动应用的方式
- android 用Luncher启动应用的方式
- android的luncher的修改
- Android 应用的启动方式
- Android中Luncher掌控图片的显示
- Android启动其他应用的方式
- android luncher布局修改
- Luncher
- Luncher
- Android中启动其它应用的几种方式
- android之luncher滑动效果
- android 创建桌面图标,luncher图标
- 启动其他应用的方式
- Android 的启动方式
- Android中的应用启动方式及优化
- android应用层-activity启动方式
- android6.0设置默认Luncher方式
- Android中从一个应用中启动另外的应用的实现方式
- linux下的作业管理
- System.Collections.ArrayList(二)
- office2007 word 从任意页插入页码,写毕业设计论文的进来看一下!
- 一个简单的MongoDB操作类
- javascript验证email
- android 用Luncher启动应用的方式
- LHS重要学习资料
- 新浪微博python API的使用
- 转《Linux调优工具oprofile的演示分析》
- 根文件系统制作
- 无法在Eclipse查看class源文件一个的解决方法
- MyEclipse 10安装svn插件
- 关于CONFIG_LOCALVERSION_AUTO设置去掉内核版本号SVN后缀
- CSS3 结构性伪类选择器