我有一个想法,想要创建一个类似于安卓图案锁的手机锁屏应用程序。我需要在手机启动/重新启动/锁屏/解锁时显示或启动我的应用程序。我不知道如何让应用程序代替默认的锁屏界面并隐藏它。
所以我的问题是:
- 如何显示或启动我的应用程序而不是默认的锁屏界面
- 什么是
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
这有什么帮助?
什么是
public class BootReciever extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
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);
}
}
}
}
这对你有什么帮助?
- 我的应用程序完成工作后,如何显示主页?