Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12487

Android: IndexOutOfBoundsException when backing out of an app after install from app store

    Details

      Description

      Reproduction steps:

      1. Create a new titanium app
      2. Put the following entry inside your tiapp.xml

      <property name="ti.android.bug2373.disableDetection" type="bool">true</property>
      

      3. Create an apk for the app via the distribute command
      4. Push the app to the phone via 'adb push myApp /mnt/sdcard/'
      5. Use some file explorer on your phone like Astro (you may need to download this) and install the app
      6. After the app has been installed, click 'open'
      7. Push home
      8. Open the same app again from the app list
      9. Repeat 7-8 a few times
      10. When you have the app open, hit back

      Expected Result:
      The app should back out without crashing

      Actual Result:
      The app crashes with the error message:

      E/AndroidRuntime(19143): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
      E/AndroidRuntime(19143): 	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
      E/AndroidRuntime(19143): 	at java.util.ArrayList.get(ArrayList.java:304)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiApplication.terminateActivityStack(TiApplication.java:201)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiRootActivity.finish(TiRootActivity.java:164)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiApplication.terminateActivityStack(TiApplication.java:205)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiRootActivity.finish(TiRootActivity.java:164)
      E/AndroidRuntime(19143): 	at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java:167)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiBaseActivity.onBackPressed(TiBaseActivity.java:609)
      E/AndroidRuntime(19143): 	at android.app.Activity.onKeyUp(Activity.java:2099)
      E/AndroidRuntime(19143): 	at android.view.KeyEvent.dispatch(KeyEvent.java:2575)
      E/AndroidRuntime(19143): 	at android.app.Activity.dispatchKeyEvent(Activity.java:2329)
      E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiBaseActivity.dispatchKeyEvent(TiBaseActivity.java:740)
      E/AndroidRuntime(19143): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1806)
      E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3327)
      E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3300)
      E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2460)
      E/AndroidRuntime(19143): 	at android.os.Handler.dispatchMessage(Handler.java:99)
      E/AndroidRuntime(19143): 	at android.os.Looper.loop(Looper.java:137)
      E/AndroidRuntime(19143): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
      E/AndroidRuntime(19143): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/AndroidRuntime(19143): 	at java.lang.reflect.Method.invoke(Method.java:511)
      E/AndroidRuntime(19143): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
      E/AndroidRuntime(19143): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
      E/AndroidRuntime(19143): 	at dalvik.system.NativeStart.main(Native Method)
      

      NOTE: This seems to happen consistently on 4.0.4 devices. This behavior varies on other versions.

        Attachments

          Activity

            People

            • Assignee:
              ayeung Allen Yeung
              Reporter:
              ayeung Allen Yeung
              Reviewer:
              Ping Wang
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15475
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code