title: Start Activity in Lock Screen on Marshmallow or Higher devices
body: <p>I'm creating a calling app with sinch service. 
  For Incoming calls, I need to unlock the lockscreen programatically. Using flags I solved this, but its not working on Nougat.</p>
  
  <p>my current code in activity:</p>
  
  <pre><code>  @Override
  protected void onStart() {
      super.onStart();
  
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
              WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|
              WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|
              WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);    }
  </code></pre>
  
  <p>and on manifest: </p>
  
  <pre><code>&lt;activity
      android:name="IncomingCallScreenActivity"
      android:noHistory="true"
      android:showOnLockScreen="true"
      android:screenOrientation="sensorPortrait"&gt;          
  &lt;/activity&gt;
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>Problem is solved. I edited in the manifest:</p>
  
  <pre><code>&lt;activity
  android:name="IncomingCallScreenActivity"&gt;
  &lt;/activity&gt;    
  </code></pre>