java - How to resolve volley Error , I am always finding error_response error? -
i getting volley error every time data has been posted ,but in response, got volley error.
please me, don't know why it's happening?
private void dosignuptask(){ string strname = nameet.gettext().tostring(); string strhandicap = handicapet.gettext().tostring(); // string strcountry = countryet.gettext().tostring(); string strcode = codeet.gettext().tostring(); string strmobile = mobileet.gettext().tostring(); string stremail = emailet.gettext().tostring(); string strpassword = passwordet.gettext().tostring(); if (strname.length() == 0) { nameet.seterror(getstring(r.string.empty_name)); }else if (strhandicap.length() == 0) { handicapet.seterror(getstring(r.string.empty_handicap)); }else if (strcode.length() == 0) { codeet.seterror(getstring(r.string.empty_code)); } else if (strmobile.length() !=10 ) { mobileet.seterror(getstring(r.string.empty_mobile)); } else if (stremail.length() == 0) { emailet.seterror(getstring(r.string.invalid_email)); } else if (!utility.isemailvalid(stremail)) { emailet.seterror(getstring(r.string.invalid_email)); }else if (strpassword.length() == 0) { passwordet.seterror(getstring(r.string.password_empty)); } else { nameet.seterror(null); handicapet.seterror(null); countryet.seterror(null); codeet.seterror(null); mobileet.seterror(null); emailet.seterror(null); passwordet.seterror(null); // phone_noview.seterror(null); string devicetoken = refferencewrapper.getdeviceinformationbean().getdevicetoken(); jsonobject jsonobject = null; try { jsonobject = new jsonobject(); jsonobject.putopt("email", stremail); jsonobject.putopt("password", strpassword); jsonobject.putopt("fullname", strname); jsonobject.putopt("handicap", strhandicap); jsonobject.putopt("token", ""); jsonobject.putopt("device_token",devicetoken); jsonobject.putopt("device_os","2"); jsonobject.putopt("country", country_name); jsonobject.putopt("country_code",strcode); jsonobject.putopt("phone", strmobile); } catch (jsonexception e) { e.printstacktrace(); } final progressdialog pdialog = new progressdialog(this); pdialog.setmessage("loading..."); pdialog.show(); //requestqueue requestqueue = volley.newrequestqueue(this); customjsonobjectrequest jsonobjectrequest = new customjsonobjectrequest(request.method.post, puttapi.sign_up_url, jsonobject, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { pdialog.dismiss(); log.e("sign up", "onresponse =" + response.tostring()); getsignupresponse(response); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { toast.maketext(getapplicationcontext(),"something, wrong please try again",toast.length_long).show(); pdialog.dismiss(); } }); jsonobjectrequest.setretrypolicy(new defaultretrypolicy(60000, defaultretrypolicy.default_max_retries, defaultretrypolicy.default_backoff_mult)); log.e("sign up", "url= " + puttapi.sign_up_url + " postobject = " + jsonobject.tostring()); //requestqueue.add(jsonobjectrequest); appcontroller.getinstance().addtorequestqueue(jsonobjectrequest); } } `
Comments
Post a Comment