Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:54:43+00:00 2026-05-29T04:54:43+00:00

When I switch between zoom to fill screen and stretch to fill screen my

  • 0

When I switch between zoom to fill screen and stretch to fill screen my application will crash. By the way I noticed that a lot of app on the market have this problem. Does anyone know how to avoid this problem.

Here’s the 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:54:44+00:00Added an answer on May 29, 2026 at 4:54 am

    The problem is inside the xml layouts, I use a scrollView in layout-normal and a listView in layout-xlarge for the same viewId. This will cause the application to crash when Android tries to restore the state of the view.

    A nice workaround can be to override the methods onSaveInstaceState and onRestoreInstaceState, this way it’s possible to avoid a classCastException

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my application requires the user to switch between several screens. The way I'm doing
I use a view switcher to switch between views in a way that is
My app needs to switch between a couple of full screen views. These views
Using QStackedWidget to switch between the views, I will be able to traverse between
I added a navigation control to switch between views in my app. But some
In order to switch between views in my iOS app, I have been using
I have three views that I switch between using a tab bar, and the
I'm looking for a way to switch between an if and an else block
I need to find a way to switch between four text inputs. Example Usage:
I have a navigation controller that utilizes an if statement to switch between the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.