java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.support.v7.widget.Toolbar$SavedState

后端 未结 4 713
情话喂你
情话喂你 2020-12-06 06:33

My app gets crashed frequently when it goes from background to foreground. Scenerio: Suppose iam playing any games and my app is in recent list and after playing,if i select

4条回答
  •  醉酒成梦
    2020-12-06 07:26

    Problem Fixed in my case:

    Issue in my case is :

    1:I have an id in xml which have same name as a layout.

    ie:in my case ,i have a custom action bar layout named as "action_bar.xml" and an id in another layout as "+id/action_bar".So this cause problem when app is not in the memory and while recreating that page .

    NOTE:DONT USE SAME ID/LAYOUT NAMES in more than one time in the app.

提交回复
热议问题