Когда я переключаюсь между zoom to fill screen
и stretch to fill screen
, мое приложение падает.Кстати, я заметил, что многие приложения на рынке имеют эту проблему.Кто-нибудь знает, как избежать этой проблемы.
Вот logcat:
E/AndroidRuntime(24475): FATAL EXCEPTION: main
E/AndroidRuntime(24475): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.macchetv.api/com.macchetv.activity.HomeActivity}: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.AbsListView$SavedState
E/AndroidRuntime(24475): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
E/AndroidRuntime(24475): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)
E/AndroidRuntime(24475): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3191)
E/AndroidRuntime(24475): at android.app.ActivityThread.access$600(ActivityThread.java:122)
E/AndroidRuntime(24475): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1031)
E/AndroidRuntime(24475): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(24475): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime(24475): at android.app.ActivityThread.main(ActivityThread.java:4126)
E/AndroidRuntime(24475): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(24475): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(24475): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime(24475): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(24475): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(24475): Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.AbsListView$SavedState
E/AndroidRuntime(24475): at android.widget.AbsListView.onRestoreInstanceState(AbsListView.java:1650)
E/AndroidRuntime(24475): at android.view.View.dispatchRestoreInstanceState(View.java:8341)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:2038)
E/AndroidRuntime(24475): at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:766)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
E/AndroidRuntime(24475): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
E/AndroidRuntime(24475): at android.view.View.restoreHierarchyState(View.java:8320)
E/AndroidRuntime(24475): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1642)
E/AndroidRuntime(24475): at android.app.Activity.onRestoreInstanceState(Activity.java:898)
E/AndroidRuntime(24475): at android.app.Activity.performRestoreInstanceState(Activity.java:870)
E/AndroidRuntime(24475): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1101)
E/AndroidRuntime(24475): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1796)
E/AndroidRuntime(24475): ... 12 more