cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederico Costa Galvão (JIRA) <>
Subject [jira] [Commented] (CB-6048) Add config setting for Android app launchMode
Date Mon, 26 May 2014 21:04:01 GMT


Frederico Costa Galvão commented on CB-6048:

This doesn't seem to be documented anywhere I could find.
Furthermore, even though upgrading to cordova 3.5.0 from 3.4.1 adds     
<preference name="AndroidLaunchMode" value="singleTop" />
 to both *platforms/android/cordova/defaults.xml* and *platforms/android/res/xml/config.xml*,
it doesn't modify the final AndroidManifest with 

Maybe that's to be included in the documentation, or maybe it should default to that even
if the root  *config.xml* doesn't specify that setting.

And as a bonus, I couldn't find the correct reasoning behind this other than very old behaviour
reported on stackoverflow and phonegap-build forum from at least a year ago where the app
would restart if clicked on the app icon instead of resuming. Has there been something else
that made this change be needed?

> Add config setting for Android app launchMode
> ---------------------------------------------
>                 Key: CB-6048
>                 URL:
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CLI
>            Reporter: Michal Mocny
>            Assignee: Michal Mocny
> As raised on mailing list: "[Android] Apps restart instead of resume when brought to
focus by clicking app icon"
> "TLDR; AndroidManifest.xml <activity> needs: android:launchMode="singleTop" --
can I add it?
> Quick search brings up:
> ..which advises to add android:launchMode="singleTask" to AndroidManifest.xml <activity>,
which does fix the issue.
> According to the descriptions in
the 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
> 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."

This message was sent by Atlassian JIRA

View raw message