android - Using page adapter without fragments -
is possible use viewpager
without fragments? examples find load several fragments viewpager.
i want use listview
. create custom adapter inflate layout according position pager in.
if it's possible can point me example ?
yes totally possible. since viewpager.setadapter()
takes instance pageadapter
, need create own subclass of pageradapter (its kinda subclassing baseadapter or arrayadapter use in listview
). remember, pageradapter docs say:
when implement pageradapter, must override following methods @ minimum:
- instantiateitem(viewgroup, int)
- destroyitem(viewgroup, int, object)
- getcount()
- isviewfromobject(view, object)
hope helps
Comments
Post a Comment