title: Change android activity while app is in background?
body: <p>My android app detects if the app is in the background (say the user pressed the home menu) using <code>ComponentCallbacks2</code>. Now, I want the app to change an activity <strong>while it is currently in the background</strong> without changing the users interface. </p>
  
  <p><strong>My only question is:</strong> How can I change the activity for when the user <strong>in the background,</strong> so that it pops up when he/she gets back to the app, rather than popping up as soon as I call <code>startActivity(Intent i)</code>.</p>
  
  <p>Here are the steps that I want my app to execute:</p>
  
  <ol>
  <li>User opens home menu in app (WORKS)</li>
  <li>App detects that app is in background (WORKS)</li>
  <li><strong>Using intents, open up another activity</strong> without <strong>disrupting</strong> whatever app the user is on (DOESN'T WORK)</li>
  </ol>
  
  <p>Right now, steps one and two are going fine. But, when I use an intent to change the activity, the activity pops open...disturbing the user. Basically, I want to load the activity, so that <strong>as soon</strong> as the user opens the app back up, it goes to the game over screen.</p>
  
  <hr>
  
  <p><strong>My research on the topic, and what I've tried to resolve the issue on my own:</strong></p>
  
  <p>I have done <strong>lots</strong> of research on this topic, but the other questions are about <strong>running</strong> processes in the background. For this, obviously, one would use a service. My question is laser focused on how I can change the activity for when the user <strong>in the background,</strong> so that it pops up when he/she gets back to the app. I have also tried to use the onContinue() method, but that gets called every time the user changes the activity, making it unreliable. </p>
  
  <p>Thanks for the expert advice:</p>
  
  <p>Rich</p>