Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

Issue with the casting but unfortunately there is no casting in android

When I am entering into a particular fragment to this fragment I am getting the below error there is no casting done in my code and I am wondering this would have been occuring

java.lang.ClassCastException: android.widget.TextView$SavedState cannot be cast to android.widget.Spinner$SavedState
            at android.widget.Spinner.onRestoreInstanceState(Spinner.java:977)
            at android.view.View.dispatchRestoreInstanceState(View.java:21578)
            at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:4713)
            at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:1261)
            at android.widget.AbsSpinner.dispatchRestoreInstanceState(AbsSpinner.java:377)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:4699)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:4699)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:4699)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:4699)
            at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:4699)
            at android.view.View.restoreHierarchyState(View.java:21556)
            at android.support.v4.app.Fragment.restoreViewState(Fragment.java:510)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1445)
            at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)
            at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:799)
            at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2580)
            at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2367)
            at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)
            at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:237)
            at android.app.ActivityThread.main(ActivityThread.java:7948)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...