• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Set Listener on View Pager swape pages?

 
Kishor Joshi
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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would call setOnPageChangeListener either on the ViewPager or the TabPageIndicator:
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!