Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Set Listener on View Pager swape pages?  RSS feed

 
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have used ViewPager in my android app to display images in my MainActivity.Know I have add a Adapter by extending PagerAdapter but Know I want to know How can i get Id of a Particular Item when it clicked?
I want to start a New Intent when a New Image is Clicked on ViewPager

Thanks
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would call setOnPageChangeListener either on the ViewPager or the TabPageIndicator:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!