的NoSuchMethodError getChildFragmentManager() [英] NoSuchMethodError getChildFragmentManager()

本文介绍了的NoSuchMethodError getChildFragmentManager()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个ViewPager与FragmentPagerAdapter,其中ViewPager本身位于一个片段里。我读过,它应该能够与最新的支持库的文档,并使用嵌套的片段。主要是我想PagerAdapter使用root片段的子片段经理。

I'm trying to implement a ViewPager with a FragmentPagerAdapter, where the ViewPager itself is located inside a fragment. I've read in the docs that it should be possible with the newest Support Library and by using nested fragments. Principally I would like the PagerAdapter to use the root fragment's child fragment manager.

所以,我的项目使用ActionBarSherlock和SherlockFragments。与ActionBarSherlock捆绑不包括方法getChildFragmentManager(),在所有支持的lib,我下载了最新的支持库V4并把它放在ActionBarSherlock和我的项目的libs文件夹了。随着这种变化的项目编译没有问题,但是在第一次运行它具有的NoSuchMethodError退出有关getChildFragmentManager()。我在做什么错在这里?

So, my project uses ActionBarSherlock and SherlockFragments. As the support lib bundled with ActionBarSherlock didn't include the method getChildFragmentManager() at all, I downloaded the newest support library v4 and placed it in the libs folder of ActionBarSherlock and my project, too. With this change the project compiles okay, but at first run it exits with a NoSuchMethodError regarding getChildFragmentManager(). What am I doing wrong here?

(附言:我测试它与Android 2.2这是我的最低目标平台。)

(P.s. I'm testing it with Android 2.2 which is my targeted minimum platform.)

谢谢!

解决:在我的项目和所有引用的库为最新版本取代了支持库。然后我打扫我的项目,但我忘了清理和重建引用的库,太...这导致了这种奇特的行为。

推荐答案

请确保任何引用的库使用支持库V13。如果你只能做的V13库将在所有的项目中引用一个使用V13使用,这似乎干扰getChildFragmentManager()方法。请参阅<一href="http://stackoverflow.com/questions/9926403/android-support-package-compatibility-library-use-v4-or-v13">THIS做一个项目 - >清理你的整个工作区时问获取更多的信息和注意控制台打印出来(假设你使用的是Eclipse)。

Make sure that none of your referenced libraries use Support Library v13. If you do only the v13 library will be used in all your projects referencing the one using v13 and this seems to interfere with the getChildFragmentManager() method. See THIS QUESTION for more info and pay attention to the console print out when doing a Project->Clean on your whole workspace (assuming you are using Eclipse).

我有同样的问题,因为你,但它得到了解决,一旦我从引用的五个图书馆之一的V13库中删除。

I had the same issue as you but it got resolved once I had the v13 library removed from one of the five Libraries referenced.

这篇关于的NoSuchMethodError getChildFragmentManager()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆