i need make request url /controller/action
. not getting expected response following code:
public class mainactivity extends activity { list<string> responselist; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); autocompletetextview auto1 = (autocompletetextview) findviewbyid(r.id.autocompletetextview1); arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_expandable_list_item_2, responselist); auto1.setadapter(adapter); } private void handleresponse(jsonobject serverresponse) { int success = 0; try { success = serverresponse.getint(responce.tag_success); if (success == 1) { progress.dismiss(); //after login want store user's id shared preferences /*sharedpreferences sharedpreferences = preferencemanager.getdefaultsharedpreferences(getapplicationcontext()); sharedpreferences.editor editor = sharedpreferences.edit(); editor.putstring("cust_id", serverresponse.getstring("customerid")); editor.commit();*/ toast.maketext(mainactivity.this, serverresponse.getstring((responce.tag_message)), toast.length_long).show(); } else { progress.dismiss(); //util.log(tag, serverresponse.getstring(responce.tag_error)); toast.maketext(mainactivity.this, serverresponse.getstring(responce.tag_message), toast.length_long).show(); } } catch (jsonexception e) { // util.log(tag, e.getmessage()); } } @override public void oncomplete(jsonobject serverresponse, int response_identifier_flag) throws jsonexception { switch (response_identifier_flag) { case 1: handleresponse(serverresponse); break; default: } } }
Comments
Post a Comment