title: How to navigate back to specific Activity after app has been in background?
body: <p>I am having a problem where when I suspend my application for a few minutes (having it stay in the background), when I bring it back to the foreground, I want it to always return to a particular activity. Right now, if I am on a particular fragment called <code>Fragment A</code>, and I want to navigate to my <code>HomeActivity</code>, I thought getting calling an <code>Intent</code> from <code>Fragment A</code> in <code>onResume</code> would work because whenever I thought that whenever I resume my activity from being in the background for a few minutes, that my Intent would trigger and take me back to the <code>HomeActivity</code>. This was my attempt:</p>
  
  <p>FragmentA.java:</p>
  
  <pre><code>    @Override
      public void onResume(){
          super.onResume();
          Intent intent = new Intent(getActivity(), HomeActivity.class);
          if(intent != null) {
              startActivity(intent);
          }
      }
  </code></pre>
  
  <p>Right now, it seems as if when I load up my app, my Fragment gets called when coming out of background, but not the "Home" screen that I want it to be called after I have my app come from the background to the foreground. By the way, the <code>HomeActivity</code> in my Android Manifest does not have the following:</p>
  
  <pre><code>        &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p>As this is for my login activity when the app first boots up.</p>
  
  <p>However, this seems to give my app a white screen where none of my UI shows, and eventually crashes my app. Is there any way I can always navigate back to an Activity in ANY fragment that I am in after the app comes to the foreground after being in the background (paused, if you will) for a few minutes? Any help would be appreciated. Thanks!</p>