Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on orientation change / restore instance state #12

Closed
siimav opened this issue Jan 27, 2016 · 2 comments
Closed

Crash on orientation change / restore instance state #12

siimav opened this issue Jan 27, 2016 · 2 comments
Assignees
Labels

Comments

@siimav
Copy link

siimav commented Jan 27, 2016

There's some kind of bug introduced with the 0.9.6 version. When changing the orientation of the device, an unhandled exception is throw from the restore instance state code. It can be replicated using the demo app. Version 0.9.5 works correctly.

FATAL EXCEPTION: main
  Process: de.codecrafters.tableviewexample, PID: 20881
  java.lang.RuntimeException: Unable to start activity ComponentInfo{de.codecrafters.tableviewexample/de.codecrafters.tableviewexample.MainActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/tableView. Make sure other views do not use the same id.
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
      at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4053)
      at android.app.ActivityThread.access$900(ActivityThread.java:156)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:211)
      at android.app.ActivityThread.main(ActivityThread.java:5373)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
   Caused by: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/tableView. Make sure other views do not use the same id.
      at android.view.View.onRestoreInstanceState(View.java:13847)
      at android.view.View.dispatchRestoreInstanceState(View.java:13823)
      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2888)
      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
      at android.view.View.restoreHierarchyState(View.java:13801)
      at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2012)
      at android.app.Activity.onRestoreInstanceState(Activity.java:1023)
      at android.app.Activity.performRestoreInstanceState(Activity.java:978)
      at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2352)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442) 
      at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4053) 
      at android.app.ActivityThread.access$900(ActivityThread.java:156) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:211) 
      at android.app.ActivityThread.main(ActivityThread.java:5373) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) 
@ISchwarz23 ISchwarz23 added the bug label Jan 27, 2016
@ISchwarz23 ISchwarz23 self-assigned this Jan 27, 2016
@ISchwarz23
Copy link
Owner

Thank you for reporting this issue. This will be fixed as soon as possible.

@ISchwarz23
Copy link
Owner

Hi siimav,
finaly I made to fix this bug. Please use the version 1.0.0 of the tableview. This version should not contain this bug anymore ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants