michael-rapp / ChromeLikeTabSwitcher

Provides a tab switcher similar to the one, which is used in Google Chrome on Android
Apache License 2.0
1.23k stars 140 forks source link

crash info #7

Closed hseury closed 6 years ago

hseury commented 7 years ago
10-20 10:30:48.933 18598 18598 E AndroidRuntime: FATAL EXCEPTION: main
10-20 10:30:48.933 18598 18598 E AndroidRuntime: Process: de.mrapp.android.tabswitcher.example, PID: 18598
10-20 10:30:48.933 18598 18598 E AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at java.util.ArrayList.get(ArrayList.java:413)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.model.TabSwitcherModel.getTab(TabSwitcherModel.java:847)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.TabSwitcher.getTab(TabSwitcher.java:1144)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.model.TabItem.create(TabItem.java:145)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.layout.phone.PhoneTabSwitcherLayout.calculateInitialTabItems(PhoneTabSwitcherLayout.java:1103)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.layout.phone.PhoneTabSwitcherLayout.onGlobalLayout(PhoneTabSwitcherLayout.java:3596)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at de.mrapp.android.tabswitcher.TabSwitcher$1.onGlobalLayout(TabSwitcher.java:255)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:912)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2152)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1291)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6362)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.Choreographer.doCallbacks(Choreographer.java:685)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.Choreographer.doFrame(Choreographer.java:621)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:751)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6175)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
10-20 10:30:48.933 18598 18598 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
hseury commented 7 years ago

reproduce step:

  1. put app in background.
  2. press app icon
michael-rapp commented 6 years ago

I was able to reproduce this issue. It does not always occur when putting the app in the background, but only if it remains there for a long time until the activity finally gets destroyed by the system (might occur earlier on devices with less memory). This behavior can be enforced when enabling the setting "Don't keep activities" in Android's developer options.

michael-rapp commented 6 years ago

Fixed in version 0.1.5.