Note that there are some explanatory texts on larger screens.

plurals
  1. POBug : Theme.Translucent & FLAG_ACTIVITY_REORDER_TO_FRONT
    primarykey
    data
    text
    <p>I have an activity with the translucent Theme :</p> <pre><code>android:theme="@android:style/Theme.Translucent.NoTitleBar" </code></pre> <p>Also the problem is reproduceable with just this Theme:</p> <pre><code>&lt;style name="MyTheme" parent="@android:style/Theme"&gt; &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt; &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt; &lt;item name="android:colorBackground"&gt;@null&lt;/item&gt; &lt;/style&gt; </code></pre> <p>This activity is loaded at startup and kept in memory (when I start this activity, I ad the <code>FLAG_ACTIVITY_REORDER_TO_FRONT</code> flag as extra).</p> <p>Problem : when I start this activity (from the menu), the activity don't show up, nothing happens. But : if I remove the translucent theme : all works fine, the activity is back to front.</p> <p>Yes onNewIntent() is called.</p> <p>And if I press back the translucent activity is the one below! But it needs to be the top. </p> <p>An example being</p> <blockquote> <p>A ( translucent activity) B C</p> <p>Stack: A</p> <p>A startActivity(B) </p> <p>Stack: A,B</p> <p>B startActivity(C)</p> <p>Stack: A,B,C</p> <p>c startActivity(A) // with flag FLAG_ACTIVITY_REORDER_TO_FRONT</p> <p>Stack <em>should be</em>: B,C,A</p> <p>but A is never brought to the front, although its onNewIntent() is called.</p> </blockquote> <p>Any ideas?</p> <p><em>Side notes</em></p> <hr> <p>Interesting unanswered question: <a href="http://groups.google.com/group/android-developers/browse_thread/thread/269c67f6b39cfe45?pli=1">http://groups.google.com/group/android-developers/browse_thread/thread/269c67f6b39cfe45?pli=1</a></p> <hr> <p><code>android:launchMode</code> of <code>singleTask</code> or <code>singleInstance</code> are not wanted to be used. These change the backstack and move activities into their own stack. Therefore we don't have A,B,C any more.</p> <blockquote> <p>singleTask and singleInstance — are not appropriate for most applications, since they result in an interaction model that is likely to be unfamiliar to users and is very different from most other applications.</p> </blockquote> <p><a href="http://developer.android.com/guide/topics/manifest/activity-element.html#lmode">http://developer.android.com/guide/topics/manifest/activity-element.html#lmode</a></p> <p>Anyone who wants a visual representation of launchModes try this app : <a href="https://play.google.com/store/apps/details?id=com.novoda.demos.activitylaunchmode">https://play.google.com/store/apps/details?id=com.novoda.demos.activitylaunchmode</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

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