Issue
I have a Fragment
that has a FrameLayout
. This first fragment (A) loads inside its Framelayout another fragment (B). When I call getParentFragment
from inner fragment (B), I get null
. How should this method be used properly?
Solution
getParentFragment() was introduced in API level 17 (Android 4.2). Android 4.2 introduced the idea of nested fragments (fragments containing other fragments). Calling this results in null if the fragment has a parent which is an Activity.
Have a look at this.
If you are using support library then you can use getParent(), may be you need to use getChildFragmentManager() while doing fragment transaction. See this
Answered By - Eurig Jones
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.