zoukankan      html  css  js  c++  java
  • 实现:编辑短信,按power键锁屏后,再点亮屏幕,进入的还是编辑短信界面,按返回键才会进入解锁界面。

    描写叙述:在编辑短信界面按电源键锁屏后,又一次按电源键点亮屏幕。并没有进入到锁屏界面而是在编辑短信界面。此时短信界面悬浮与锁屏界面之上。这时按返回键关闭编辑短信界面。回到锁屏界面,是怎样实现的呢,仅仅须要在须要实现该功能的界面(Activity)中的onCreate()方法中setContentView()方法之前加入下面代码:

         // set this flag so this activity will stay in front of the keyguard
            int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
            WindowManager.LayoutParams lp = getWindow().getAttributes();
            lp.flags |= flags;


  • 相关阅读:
    foreach和each
    one
    存储
    动态添加
    百度描点
    php环境配置
    图文并茂
    css实现鼠标移上去变大,旋转,转别人的额
    vagrant box打包前的准备
    VirtualBox压缩打包
  • 原文地址:https://www.cnblogs.com/lxjshuju/p/7201748.html
Copyright © 2011-2022 走看看