Yes, and that's what's so frustrating, Kastya. The breakpoints appear to 
indicate that everything is working, as does the fact that it responds to a 
swipe. For example, if I start it off by calling ViewPager with 
setCurrentItem(3), my instantiateItem is called with position=3, followed 
by position==2 and 4 (the views to either side). When swiping to go to the 
right, destroyItem is called with position=2 and instantiateItem position=5 
as expected. isViewFromObject is called numerous times and I correctly 
return true or false. Since the data in the adapter never changes, 
getItemPosition always returns POSITION_UNCHANGED per the specs.

I feel like there is something I'm missing that is failing to make my views 
"visible", or else there is some undocumented "feature" since they do not 
provide much info for using the base PagerAdapter (all the samples are 
using FragmentPagerAdapter or FragmentStatePagerAdapter. I am now 
considering changing over to use fragments instead of simple views since I 
know that works even though to me it seems less efficient in this case.

Thanks for your response in any case!

  -- Doug


On Monday, November 24, 2014 5:09:31 PM UTC-5, Kostya Vasilyev wrote:
>
> Did you properly implement the adapter's isViewFromObject?
>
> How about getItemPosition?
>
> -- K
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to