Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>this is a little bit late, but since i just came across this - as Matt mentions, the flag activity single top in the manifest and in the intent are not the same (at least on previous versions of android).</p> <p>in <code>startActivityUncheckedLocked</code> method:</p> <p>on gingerbread - <a href="https://github.com/android/platform_frameworks_base/blob/gingerbread/services/java/com/android/server/am/ActivityStack.java">https://github.com/android/platform_frameworks_base/blob/gingerbread/services/java/com/android/server/am/ActivityStack.java</a></p> <p>look at line 2204 --</p> <pre><code> if ((launchFlags&amp;Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0 &amp;&amp; taskTop.realActivity.equals(r.realActivity)) { </code></pre> <p>so it's just checking the launch flags on the intent, and not checking the manifest. compare this to jellybean mr1 release:</p> <p><a href="https://github.com/android/platform_frameworks_base/blob/jb-mr1-release/services/java/com/android/server/am/ActivityStack.java">https://github.com/android/platform_frameworks_base/blob/jb-mr1-release/services/java/com/android/server/am/ActivityStack.java</a></p> <p>look at line 2835 --</p> <pre><code> if (((launchFlags&amp;Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0 || r.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP) &amp;&amp; taskTop.realActivity.equals(r.realActivity)) { </code></pre> <p>so it seems that in mr1, they are checking r.launchMode (presumably the <code>AndroidManifest.xml</code> value) in addition to the <code>launchFlags</code> (presumably of the intent itself), whereas in the older versions, they were only checking the intent flags.</p> <p>it was actually fixed on february 16th, 2012, in this commit: <a href="https://github.com/android/platform_frameworks_base/commit/f363dfd26c304bca33f12065a9ed3de291193962">https://github.com/android/platform_frameworks_base/commit/f363dfd26c304bca33f12065a9ed3de291193962</a></p> <p>short version is - set the single top flag in both the intent and in the manifest.</p> <p>(thanks to this comment on the associated bug in the android bug tracker for pointing me to which source file to look in - <a href="http://code.google.com/p/android/issues/detail?id=4155#c9">http://code.google.com/p/android/issues/detail?id=4155#c9</a>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload