I have an idea of creating my own phone lock app similar to android pattern lock. I need to display or start my app whenever the phone boots/restarts/phone, lock/phone, and unlock. I don't know how to make the app appear instead of default lock screen and to hide the default lock screen. So my questions are:
- How to display or start my app instead of default lock screen
What is
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);
How this is helpful?
What is
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); } } } }
How this is helpful?
- How do you show the home page after my app finishes its work?