Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C7F010C80 for ; Wed, 28 Aug 2013 21:45:53 +0000 (UTC) Received: (qmail 11900 invoked by uid 500); 28 Aug 2013 21:45:53 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 11875 invoked by uid 500); 28 Aug 2013 21:45:53 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 11823 invoked by uid 99); 28 Aug 2013 21:45:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Aug 2013 21:45:53 +0000 Date: Wed, 28 Aug 2013 21:45:53 +0000 (UTC) From: "Jason Farnsworth (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-3949) Add code fix to broken activity sequence MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13752888#comment-13752888 ] Jason Farnsworth commented on CB-3949: -------------------------------------- Thank you. > 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 > Attachments: Cordova281-debug.apk > > > If installing an app via sideloading on Android and opening it immediately after install via package installer, going through several pages, then pressing Home and later resuming the app later via opening the app from the may break the page sequence by creating a new CordovaActivity instance on top of the previous one. > Tested on a Galaxy Nexus, Android 4.2 > Steps to replicate: > # Copy attached APK over to phone storage and install it. > # Click 'Open' when the package installer has installed the app, instead of clicking 'Done' > # Press the button in index.html to open the next page. > # Press Home to pause the app, then reopen the app from the app drawer (not the Recent Apps list). > # 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, instead of returning to where the user last was) > # Pressing back at this index page closes the new CordovaActivity and returns to the second page from the previous activity. > 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. Some bugs filed on Android's issue tracker suggest this can happen by clicking 'Open' on apps freshly installed from the Play Store too. > This probably is an Android issue with the package installer (probably due to the package installer calling a non-standard intent) and not PhoneGap, but appears to be fixed by using singleTop as the activity launch mode, or 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 isn't the root activity. Clearing it and returning to the root activity."); > 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