Fragment error

本文针对使用ActionBarSherlock兼容库时出现的FragmentManager保存状态错误及指定子视图已有父视图的问题,提供了具体的解决方案,包括更换适配器类型及查看Stack Overflow上的详细解答。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误:

04-16 15:21:15.159: E/AndroidRuntime(19365): at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1576)

解决:

I've stumbled upon the same problem while using ActionBarSherlock compatibility library. The workaround is that your adapter extends FragmentStatePagerAdapter instead of FragmentPagerAdapter

 

错误:

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
05-17 19:44:03.518: DEBUG/UNHANDLED_EXCEPTION(7735): at android.view.ViewGroup.addViewInner(ViewGroup.java:1976)

解决:

http://stackoverflow.com/questions/6035711/android-fragment-with-compatibility-package-on-2-3-3-creates-specified-child

转载于:https://www.cnblogs.com/anfflee/archive/2013/05/31/3111091.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值