android - ViewPager with arraylist updating the value of views not working -
screen1 screen 2
now screen1 should appear 1st screen 2 appears first.. below button whole view inside th view pager
my view inside view pager , view updated values of arraylist. same view update whenever instantiateitem() called. have used following code indexing result inappropriate. please me this,
public class mypageradapter extends pageradapter { // private view mcurrentview; // int pos; // @override // public void setprimaryitem(view container, int position, object object) { // mcurrentview = (view)object; // // } @override public object instantiateitem(viewgroup collection,int position) { log.d("pos",""+position); pagerview = new view(collection.getcontext()); //collection.settag(position); layoutinflater inflater = (layoutinflater) collection.getcontext() .getsystemservice(context.layout_inflater_service); pagerview = inflater.inflate(r.layout.newmainviewpager, null, false); lvmenu=(listview)pagerview.findviewbyid(r.id.lvmenuitem); imgmainitem=(imageview)pagerview.findviewbyid(r.id.imgdisplay); edqty=(textview)pagerview.findviewbyid(r.id.edqty1); btnadd=(button)pagerview.findviewbyid(r.id.btnadd); btnsub=(button)pagerview.findviewbyid(r.id.btnsub); tvdesc=(textview)pagerview.findviewbyid(r.id.tvdesc); btnpurchaseorder=(button)pagerview.findviewbyid(r.id.btnplaceorder); btnpurchaseorder.setonclicklistener(revisedmainmenu.this); imgfbconnect=(button)pagerview.findviewbyid(r.id.imgfbconnect); displaymenu(position); ((viewpager) collection).addview(pagerview, 0); return pagerview; } @override public void destroyitem(final view arg0, final int arg1, final object arg2) { ((viewpager) arg0).removeview((view) arg2); } @override public boolean isviewfromobject(final view arg0, final object arg1) { return arg0 == ((view) arg1); } @override public void finishupdate(view arg0) { // todo auto-generated method stub } @override public void restorestate(parcelable arg0, classloader arg1) { // todo auto-generated method stub } @override public parcelable savestate() { // todo auto-generated method stub return null; } @override public void startupdate(view arg0) { // todo auto-generated method stub } @override public int getcount() { // todo auto-generated method stub return menuidlst.size(); } @override public int getitemposition(object object) { return position_none; } }
please me guys
Comments
Post a Comment