android fragments - ViewPager inside RecyclerView -
i have recyclerview
20 viewpagers (viewpager
fragment) want display different pictures inside viewpagers hel of fragments. have problems viewpagers. first viewpager
ok!, next 19 clear, without pics. after scroll down , up, pictures appears in viewpager
, after swipe on viewpager
disappear.
here viewpager
adapter:
public class viewpageradapter extends fragmentpageradapter { arraylist<string> mpics; public viewpageradapter(fragmentmanager fm, arraylist<string> pics) { super(fm); mpics = pics; (string pic: mpics) { log.d("!!!!!!!->",pic); } } @override public fragment getitem(int position) { return viewpagerfragment.newinstance(mpics,position); } @override public int getcount() { return mpics.size(); }}
and recyclerview onbindviewholder
@override public void onbindviewholder(final flatviewholder flatviewholder, int position) { flat flat = mflat.get(position); if (flat.getadv_pics().size()>0){ viewpageradapter viewpageradapter = new viewpageradapter( fragmentmanager,(arraylist) flat.getadv_pics() ); flatviewholder.viewpager.setadapter(viewpageradapter); }else{ } }
Comments
Post a Comment