Saturday, September 17, 2011

Re: [android-developers] Handling Adjacent Fragments in ViewPager Contributing to Options Menu


Hi! I think it may be a little bit offtopic, but as you are talking about changing PageAdapter and ViewPager apis, I'd like to ask if it is possible to expose some method to get the fragment after you have added it to a ViewPager. 

I'm asking that because if you have to handle a ScreenOrientation after the fragment has been added, there is no way to get a reference to them later, unless you keep a reference to your fragments in a static variable. Another approach I used was to use the FragmentManager.putFragment() method to keep the fragment reference for me.

I noticed the FragmentPagerAdapter adds the fragments with a tag based on his position and parent id through the method makeFragmentName. I think it would be nice if external code could get access to this method so we could have access to the fragments inside the viewpager through the findFragmentByTag().

Thanks in advance.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment