private void dupSupplier(RequestParams params) { // TODO Auto-generated method stub AsyncHttpClient checkdup=new AsyncHttpClient(); checkdup.get("http://WebServices.SuppliersMax.com/SuppliersMax.svc/CheckDuplicateSupplierRegistration",params ,new AsyncHttpResponseHandler(){ public void onSuccess(String response){ try{ JSONObject obj = new JSONObject(response); JSONArray data = obj.getJSONArray("CheckDuplicateSupplierRegistration"); for(int i=0;i<data.length();i++) { JSONObject user = data.getJSONObject(i); if(user.getString("ID")!="0") { String sid=user.getString("sSubscriberName"); Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(), "User Exist..use another name", Toast.LENGTH_SHORT).show(); } } }catch(JSONException e){ Toast.makeText(getApplicationContext(), "Error Occured [Server's JSON response might be invalid]!", Toast.LENGTH_LONG).show(); e.printStackTrace(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)