cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Braden Shepherdson <bra...@chromium.org>
Subject Re: [Android] Apps restart instead of resume when brought to focus by clicking app icon
Date Fri, 14 Feb 2014 19:14:46 GMT
I think singleTop is "not recommended" for typical Android apps, that want
to go opening different activities using various Intents from
notifications. For something like Cordova, avoiding that restart is ideal.

Braden


On Fri, Feb 14, 2014 at 2:08 PM, Michal Mocny <mmocny@google.com> wrote:

> TLDR; AndroidManifest.xml <activity> needs: android:launchMode="singleTop"
> -- can I add it?
>
> Quick search brings up:
>
> http://stackoverflow.com/questions/10122449/phonegap-android-application-restarting-instead-of-resuming-although-it-was-not
>
> ..which advises to add android:launchMode="singleTask" to
> AndroidManifest.xml <activity>, which does fix the issue.
>
> According to the descriptions in
> http://developer.android.com/guide/topics/manifest/activity-element.htmlthe
> differences mostly stem in how the app handles intents, however, there
> is a comment in the table of descriptions which labels singleTask
> launchMode as  "(not recommended for general use)".
>
> On the other hand, singleTop mode *is* recommended, and also fixes the
> issue, and according to the description, sounds to me like a much better
> default.
>
> So, does anyone have a reason to not set android:launchMode="singleTop" in
> the default cordova-android platform template?
>
> I notice Simon commented on the above SO question, so I guess we were
> already aware of the issue a while ago.  Is there a conscious reason for
> not setting that launchMode by default, or did this just slip through the
> cracks?  Is there a known downside?
>
> -Michal
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message