如何让一个activity 浮在锁屏界面的上方,返回即进入解锁界面。 譬如在锁屏界面,来电时是不需要先解锁才能接听电话的。这样能带来快捷。 如果你想在android 上实现 iphone 4s 上面在锁屏界面就能进照相机的话也可以按此方式来进行。 只需要在 Camera 的 activity 的 onResume 函数中添加如下 flag 即可实现。
import android.view.Window; import android.view.WindowManager;
final Window win = activity.getWindow(); final WindowManager.LayoutParams params = win.getAttributes(); params.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
/** Window flag: special flag to let windows be shown when the screen
* is locked. This will let application windows take precedence over
* key guard or any other lock screens. Can be used with
* {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
* directly before showing the key guard window. Can be used with
* {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
* non-secure keyguards. This flag only applies to the top-most
* full-screen window.
*/
public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;

更多相关文章

  1. 用Android访问本地站点---(localhost,10.0.2.2)要区别
  2. 利用Android游戏引擎Angle开发界面
  3. Genymotion安装及使用教程详解
  4. Android之高仿微信聊天的界面
  5. [置顶] Android(安卓)长按Listview 每个item底部弹出菜单
  6. Android(安卓)3D游戏开发技术详解与典型案例
  7. Android如何打开/关闭系统解锁服务?—典型错误分析
  8. Android小项目之八 界面细节
  9. Google 披露 Android(安卓)5.0 的三大安全特性

随机推荐

  1. Android 4.0 external下功能库说明
  2. Android报错之.android/repositories.cfg
  3. Android使用FFmpeg(一)--编译ffmpeg
  4. android中求区域内两个坐标之间的距离的
  5. 《Gradle 权威指南》读书笔记——第八章
  6. Android Studio(七):项目从Eclipse到Andro
  7. 如何调用android内置图片,比如menu->add的
  8. Android SDK Download List
  9. Android Context 详解
  10. Android(安卓)网络通信框架Volley简介