0

Based on FragmentPagerAdapter, I have inflated my view pager and I can see my items in each page. How to know, which page is clicked by user to direct him/her see detail of information?

Thanks

Hesam
  • 52,260
  • 74
  • 224
  • 365

1 Answers1

0

As far as I know, there is no way to get the current displayed Fragment by the FragmentPagerAdapter, so what I can suggest is keep an position member variable for each Fragment that is added in the pager so you can use that to know which fragment is clicked.

Ovidiu Latcu
  • 71,607
  • 15
  • 76
  • 84
  • Thanks Ovidiu Latcu, what about ViewPager? I didn't find find any interface like the interface that list has(View.OnItemSelected Listener). ViewPager just has OnClickListener which will not be activated when I click on it regardless of which page i am. – Hesam Jul 17 '12 at 08:41