Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android PagerAdapter, get current position

I want to get the current position of the visible view of my PagerAdapter

I didn't see an obvious function like getPosition() and I want one.

I want to add an object into its arraylist at that position, but I need to know it first

like image 624
CQM Avatar asked Dec 16 '11 17:12

CQM


1 Answers

You would use:

int position = mViewPager.getCurrentItem() 
like image 133
Jona Avatar answered Sep 18 '22 13:09

Jona