You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2013/06/20 21:04:22 UTC

[jira] [Comment Edited] (CB-3949) Add code fix to broken activity sequence

    [ https://issues.apache.org/jira/browse/CB-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689527#comment-13689527 ] 

Joe Bowser edited comment on CB-3949 at 6/20/13 7:04 PM:
---------------------------------------------------------

This is a pretty weird way to load an application.  Do you know if this happens if you download an app from a server as well?
                
      was (Author: bowserj):
    This is a pretty weird way to load an application.  Do you know if this happens if you download an app from a webserver as well?
                  
> Add code fix to broken activity sequence
> ----------------------------------------
>
>                 Key: CB-3949
>                 URL: https://issues.apache.org/jira/browse/CB-3949
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.7.0, 2.8.0
>            Reporter: Kuan Yi Ming
>            Assignee: Joe Bowser
>            Priority: Minor
>
> If installing an app via sideloading on Android, going through several pages, then pressing Home and later resuming the app later may break the page sequence.
> Tested on a Galaxy Nexus, Android 4.2
> Steps to replicate:
> # Copy APK over to phone storage and install it.
> # Click 'Open' when the package installer has installed the app, instead of clicking 'Done'
> # Open several pages (e.g. index.html -> page1.html -> page2.html)
> # Press Home to pause the app, then reopen the app from the app drawer.
> # The app will relaunch as if it were a new activity instance (showing splashscreen again if configured, and adds index.html to the page sequence)
> These steps can't be replicated if the app was originally opened in the app drawer, a shortcut in the homescreen, or launched via Eclipse's Run button. 
> This probably is an Android issue and not PhoneGap, but appears to be fixed by adding code before calling super.loadUrl() in the activity to check for Intent anomalies:
> {code:java}
>         Intent intent = getIntent();
>         String intentAction = intent.getAction();
>         if (!isTaskRoot() && intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null) {
>         	if(intentAction.equals(Intent.ACTION_MAIN)) {
> 	            Log.d("Cordova", "This activity should be the root. Finish it first before launching.");
> 	            finish();
> 	            return;
>         	}
>         }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira