您的位置:首页 > 移动开发 > Android开发

解决android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState

2016-02-15 17:35 435 查看
多个fragment并列,各个fragment中含有radioButton,反复切换fragment,再次执行ViewPager.setCurrentItem(1)时会崩溃报错android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState。

----------解决办法:把radioButton换成其他控件即可(如Textview)。原因分析:切换后由于之前fragment的radioButton再次改变保存状态发生强制转换类型错误。(原因仅仅是猜想,如有准确原因分析请多指教探讨)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: