Когда я переключаюсь между zoom to fill screen
и stretch to fill screen
, мое приложение будет разбиваться. Кстати, я заметил, что у многих приложений на рынке есть эта проблема. Кто-нибудь знает, как избежать этой проблемы.Android: «масштабирование для заполнения экрана» и «растягивание до заполнения экрана»
Вот 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
что делает LogCat сказать – JohnCookie
разместить код, чтобы мы могли узнать ваши проблемы – Akram
долю код – Arslan