Android EditText getText() in custome list view -
i have custom list view edittext in each item. need gettext() edittext. here part of code :
@override public view getview(int position, view convertview, viewgroup parent) { detaillist2 = db.getallinventoryitem(); viewholder holder; final int _position = position; if (convertview == null) { convertview = l_inflater.inflate(r.layout.activity_today_sales_list_view, null); holder = new viewholder(); holder.txt_itemname = (textview) convertview.findviewbyid(r.id.itemnametb); holder.txt_itemprice = (textview) convertview.findviewbyid(r.id.pricetb); holder.txt_itemquantity = (textview) convertview.findviewbyid(r.id.quantitytb); holder.txt_plusbtn = (button) convertview.findviewbyid(r.id.addbtn); holder.txt_minusbtn = (button) convertview.findviewbyid(r.id.minusbtn); holder.txt_salesprice = (edittext) convertview.findviewbyid(r.id.price); holder.txt_plusbtn.settag(holder); holder.txt_minusbtn.settag(holder); holder.txt_salesprice.setid(_position); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } holder.txt_itemname.settext(itemdetailsrraylist.get(position).getitemname()); holder.txt_itemprice.settext("rm "+itemdetailsrraylist.get(position).getitemcost()); holder.txt_salesprice.setonfocuschangelistener(new view.onfocuschangelistener() { public void onfocuschange(view v, boolean hasfocus) { } }); return convertview; }
is ok if use setonfoucschangelistener or shall use other listener ? please helps . !
Comments
Post a Comment