Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6048

Add config setting for Android app launchMode

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      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: 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.html 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 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."

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mmocny Michal Mocny
                Reporter:
                mmocny Michal Mocny
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: