android - AsynkTask returning null on method -
the problem method doinbackground homecoming 0 onpostexecute , tried lot dind't how prepare , please help
@override protected string doinbackground(string... params) { makecount(url_orders_us,count); homecoming null; }
here method
public void makecount(string uri,int countnow){ list<namevaluepair> paramus = new arraylist<namevaluepair>(); jsonobject json = jsonparser.makehttprequest(uri, "get", paramus, savedtoken); seek { jsonobject info = json.getjsonobject("data"); jsonobject orders = data.getjsonobject("orders"); iterator<string> orderiterator = orders.keys(); while (orderiterator.hasnext()) { try{ jsonobject c = orders.getjsonobject(orderiterator.next()); countnow++; } catch(exception e){ e.printstacktrace(); } } }catch (jsonexception e){e.printstacktrace();} }
and onpostexecute
@override protected void onpostexecute(string s) { usac.settext(string.valueof(count)); pdialog.dismiss(); }
countnow passed value of other parameter in java. declare fellow member of asynctask cuatom class u've created because you're modifying local re-create , not global behaviour u want achieve
android android-asynctask
No comments:
Post a Comment