title: Forcing my activity to foreground?
body: <p>I have a launcher style app. Once the user launches an app, a clock starts ticking and after a certain amount of time, the user is brought back to the main activity of my app and informed that time is up.</p>
  
  <p>To achieve this, I have an AsyncTask whose doInBackground regularly checks how much time has elapsed (this part works fine). Then:</p>
  
  <pre><code>    protected void onPostExecute(String s) {
          super.onPostExecute(s);
          Intent intent = new Intent(getApplicationContext(), HomeScreenMain.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
          startActivity(intent);
      }
  </code></pre>
  
  <p>The only problem with this is that it keeps my app in the background, although I assume that the proper activity is launched. So my question is, how, when the time has expired, can I not only start this activity but bring it to the foreground on top of any app that the user may have launched from within my app?</p>