当屏幕打开/关闭时,Android显示自己的锁,而不是默认锁

当屏幕打开/关闭时,Android显示自己的锁,而不是默认锁,android,locking,broadcastreceiver,Android,Locking,Broadcastreceiver,我想打开我创建的锁,而不是默认的,当手机启动时,我的锁被调用。但我想知道,当我的屏幕在锁定后何时打开时,我如何称呼我的锁(我的锁活动)意味着我想在屏幕打开或手机重新启动或始终打开时显示我的锁,而不是默认设置。就像在我们的手机中,锁一直在打电话一样,我想一直打我的锁(通过启动完成)。因此,请任何人帮助我如何在屏幕打开/关闭时呼叫我的锁。请尽快帮助,谢谢。。。。我做的引导时间调用我的锁正是我想要的屏幕开/关 { <receiver android:name=".Boot

我想打开我创建的锁,而不是默认的,当手机启动时,我的锁被调用。但我想知道,当我的屏幕在锁定后何时打开时,我如何称呼我的锁(我的锁活动)意味着我想在屏幕打开或手机重新启动或始终打开时显示我的锁,而不是默认设置。就像在我们的手机中,锁一直在打电话一样,我想一直打我的锁(通过启动完成)。因此,请任何人帮助我如何在屏幕打开/关闭时呼叫我的锁。请尽快帮助,谢谢。。。。我做的引导时间调用我的锁正是我想要的屏幕开/关

    { <receiver
        android:name=".BootReciever"
        android:enabled="true"
        android:exported="true" >
        <intent-filter android:priority="1" >

            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver> } in menifest
{
}在梅尼费斯特

我给出自己的答案:在我的BootReceiver类中使用以下方法:

 `enter code here`


           @Override
       public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
           if (intent.getAction() != null) {
                 if (intent.getAction().equals(Intent.ACTION_USER_PRESENT)) {
                  Intent s = new  Intent(context,ViewPagerMainActivity.class);
                  s.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

                  context.startActivity(s);
                  }
             }
        }
在menifest文件中使用以下命令:

enter code here : use : <action android:name="android.intent.action.USER_PRESENT" />
        <receiver
        android:name=".BootReciever"
        android:enabled="true"
        android:exported="false" >
        <intent-filter android:priority="1" >
            <action android:name="android.intent.action.SCREEN_ON" />
            <action android:name="android.intent.action.SCREEN_OFF" />
            <action android:name="android.intent.action.USER_PRESENT" />
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>
在此处输入代码:使用: