Skip to content

Instantly share code, notes, and snippets.

@kpgalligan
Created September 6, 2013 01:13
Show Gist options
  • Save kpgalligan/6458308 to your computer and use it in GitHub Desktop.
Save kpgalligan/6458308 to your computer and use it in GitHub Desktop.
Using "layout-w600p" and similar can be dangerous. Rotating some devices will cause a different layout resource to be used, and if a View class is different, there may be a ClassCastException on restore. Use "laout-sw600p".
http://stackoverflow.com/questions/14880746/difference-between-sw600dp-and-w600dp
Caused by: java.lang.ClassCastException: org.lucasr.twowayview.TwoWayView$SavedState cannot be cast to android.widget.AbsListView$SavedState at android.widget.AbsListView.onRestoreInstanceState(AbsListView.java:1833) at android.view.View.dispatchRestoreInstanceState(View.java:12231) at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:2613) at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:790)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment