1

I have the same issue has this post: android.support.v4.app.Fragment: undefined method getChildFragmentManager(). I need to use getChildFragmentManager() because I'm using nested fragments.

My problem is: the solution in the other post does not work for me:

  • My SDK is updated.
  • I got my android-support-v4 from the SDK folder.
  • I added android-support-v4 both the my project and ABS.

Here is my libs:

enter image description here

How can I correctly use this method?

Community
  • 1
  • 1
dasdasd
  • 1,971
  • 10
  • 45
  • 72
  • check this too...http://stackoverflow.com/questions/16945904/the-method-getchildfragmentmanager-is-undefined – android_guy Oct 17 '13 at 16:34
  • And i think your are trying to use it for android API level less than 17 and the method `getChildFragmentManager()` is only for API 17 and higher. – android_guy Oct 17 '13 at 16:38

3 Answers3

1

Not sure if you've resolved your issue yet, but I was having the same issue and I resolved it. The getCildFragmentManager() method is a method of the class Fragment and not FragmentActivity. Just because your class extends fragment activity does not mean you'll have access to this method. What I did is I created an instance of my fragment in which I wanted to place the child fragment and invoked the method through that fragment instance. There are obviously other approaches to this, but this worked for me.

crispo
  • 11
  • 1
0

maybe something in your android manifest, look at the header or 'footer of your android manifest about minimum SDK version.

ssm
  • 1
0

This is because by using old android.support.v4.

once you change the latest library.it will solved I solved it by change it. Hope it will work