ANDROID : can't get message from handler -
i've been waste 4 hours search answers still haven't found yet. tried message handler, , homecoming info json :
it homecoming info :
{"result": true, "trx_id": "2014222712220347248", "t_id": "this_is_my_t_id" }
i can value, not per fields, want t_id in case.
anyone can help me? in advance
this code :
handler myhandler = new handler(new handler.callback() { @override public boolean handlemessage(message message) { textview textview = (textview) someapi.this .findviewbyid(r.id.textviewresult); textview.settext("result : " + message.getdata().getstring("result")); homecoming true; } });
update :
solved seek :
jsonobject jsonobj; seek { jsonobj = new jsonobject(coba); log.d("data!", jsonobj.getstring("t_id")); } grab (jsonexception e) { // todo auto-generated grab block e.printstacktrace(); }
thanks.
you can seek :
via json object can fetch value of specific string.
jsonobject jsonobj = new jsonobject(message); jsonobj.getstring("t_id");
android handler message
No comments:
Post a Comment