title: Activity.startLockTask() from one Activity to another Activity
body: <p>I am using <code>Activity.startLockTask()</code> and have noticed that if I pin the screen in Activity A, I am unable to transition to Activity B. It seems like I have to <code>startLockTask()</code> and then <code>stopLockTask()</code> and then <code>startLockTask()</code> again on Activity B.</p>
  
  <p>Is there a way a better way of doing handling this so that I can pin the entire app, regardless of what Activity I am on?</p>
  
  <p>This is how I pin the app:</p>
  
  <pre><code>// start lock task mode if it's not already active
  ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
  // ActivityManager.getLockTaskModeState api is not available in pre-M
  if (Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.M) {
      if (!am.isInLockTaskMode()) {
          startLockTask();
      }
  } else {
      if (am.getLockTaskModeState() == ActivityManager.LOCK_TASK_MODE_NONE) {
          startLockTask();
      }
  }
  </code></pre>
  
  <p>This is how I am stop pinning</p>
  
  <pre><code>stopLockTask()
  </code></pre>