title: How to make our own lock screen in android instead of default lock screen
body: <p>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:</p>
  
  <ol>
  <li>How to display or start my app instead of default lock screen</li>
  <li><p>What is</p>
  
  <pre><code>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);
  </code></pre></li>
  </ol>
  
  <p>How this is helpful?</p>
  
  <ol start="3">
  <li><p>What is </p>
  
  <pre><code>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);
              }
          }
      }
  }
  </code></pre></li>
  </ol>
  
  <p>How this is helpful?</p>
  
  <ol start="4">
  <li>How do you show the home page after my app finishes its work?</li>
  </ol>