title: Android: launchMode singleTop not working if app opened from another app
body: <p>I have an application, which misbehaves if started from another app (e.g. over the playstore). Instead of resuming to the already existing <code>Activity</code>, it restarts as a new instance.</p>
  
  <p>What I have:</p>
  
  <ul>
  <li>declared every activity with <code>launchMode="singleTop"</code>in <code>manifest.xml</code></li>
  <li><strong>I tried the same with</strong> <code>launchMode=singleTask</code>, but it has the same behaviour</li>
  <li>used additional <code>intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)</code> on every <code>Intent</code> which starts a new <code>Activity</code></li>
  <li><code>onNewIntent()</code> is not called in already running instance </li>
  </ul>
  
  <p>I used following code, to start my app from another app (with, and without additional <code>addFlag()</code>)</p>
  
  <pre><code>Intent launchIntent = getPackageManager().getLaunchIntentForPackage("my.package.name");
  launchIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
  startActivity(launchIntent);
  </code></pre>
  
  <p>My Launcher-Activity is a <code>SplashScreenActivity</code>, which starts the <code>MainActivity</code>if user is logged in with the following code and gets <code>finished()</code></p>
  
  <pre><code> Intent intent = null;
   intent = new Intent(SplashScreenActivity.this, HomeActivity.class);
   intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
   startActivity(intent);
   finish();
  </code></pre>
  
  <p>What am I missing? Any recommendations are welcome!</p>