tags:

views:

107

answers:

1

Hi,

Edit / Update:

As an update to the below problem, I found the exact action which causes it to happen.

  1. Download an apk from a url through the android browser
  2. Install the app.
  3. After install, the app gives you two choices: "Open" or "Done".
  4. If you choose "Open", the quirky behavior described below starts.
  5. If you choose "Done", then launch the app from the app tray, it works fine.

So it seems like this problem is caused by using the "Open" button the browser provides you after installing the APK.


I'm experiencing an error in the history stack of applications upon first install. I made a test app to demonstrate this.

The test app is simply two activities, A and B. Activity A launches B. That's all it does. Rest is wizard generated template code from eclipse.

When the user installs the app (via web url apk), and runs it for the first time, I get an out-of-order activity stack:

-User starts the app, A is on top.
-They make A launch B by clicking a button. B is on top of the stack.
-User hits the home screen button.
-User returns to the app, A is displayed, instead of B.
-User hits the back key, B is shown!
-User hits the back key again, A is shown!
-User hits the back key again, home screen shown.
-Now the stack is clean, and app behaves "normally" from now on!

Is any one else seeing this? This is almost exactly like this known bug, however my users are not installing from eclipse: http://code.google.com/p/android/issues/detail?id=2373&q=first%20%20i...

I can provide the test app/source if anyone wants to try. This is the manifest, which does not have any special customizations made to it.

<activity android:name=".ActivityA"
          android:label="ActivityA"
  >
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
</activity>

<activity android:name="ActivityB"
          android:label="ActivityB"
  >
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>

as far as I know, this should definitely not be happening, and works fine after you clear the history stack the first time.

Thanks

A: 

Check how I workarounded this - http://github.com/cleverua/android_startup_activity

Arhimed