android - getjson as response in retrofit 2.0 -
iam trying json resopse come improper json format how can string in proper format
call<hashmap<object,object>> call = restclient.getclient().aladata(apputil.getauthkey(dashboardactivity.this),string.valueof(mselectedcategory.getid()), string.valueof(mlat), string.valueof(mlng), string.valueof(50), string.valueof(offset * 50)); call.enqueue(new callback<hashmap<object,object>>() { @override public void onresponse(call<hashmap<object,object>> call, response<hashmap<object,object>> response) { string hashmapstring=response.body().tostring(); try { jsonobject jsonobject=new jsonobject(hashmapstring); string jsonstr=jsonobject.tostring(); } catch (jsonexception e) { e.printstacktrace(); } hashmap<object,object> hashmap2=response.body(); } @override public void onfailure(call<hashmap<object,object>> call, throwable t) { } }); }
when work retrofit should use jsonobject
instead of jsonobject
.
hope helps!
Comments
Post a Comment