title: Android activity over lock screen
body: <p>I need help with my project , I'm supposed to make a BroadcastReceiver fires up a full screen activity over current lock screen .
  I tried this on my activity :</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Log.i("onCreate","success");
      PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
  
      PowerManager.WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "TAG");
      wakeLock.acquire(10*60*1000L /*10 minutes*/);
      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);
      this.setShowWhenLocked(true);
      this.setTurnScreenOn(true);
      setContentView(R.layout.activity_stop);
  }
  </code></pre>
  
  <p>BroadcastReceiver:</p>
  
  <pre><code>Intent i = new Intent(context,StopTheAlarm.class);
          i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          context.startActivity(i);
  </code></pre>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>&lt;activity android:name=".Stop"
           android:showOnLockScreen="true"
           android:screenOrientation="sensorPortrait"&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>but it doesn't work on my android 7.0.1 phone</p>