This is my JSON data which is I am getting from the server {"success":1,"message":"Thanks for the register."}. I want to extract this 1 from the success. Please help me how should I so this.
@Override
protected void onPostExecute(String result) {
try {
JSONObject reader= new JSONObject(result);
JSONObject obj1 = reader.getJSONObject("success");
String check = obj1.toString();
if (check.equals("3")) {
Toast.makeText(SignUpActivity.this, "You are already registered with us",
Toast.LENGTH_LONG).show();
emailText.setText("");
Intent intent = new Intent(SignUpActivity.this,ReferalIdActivity.class);
startActivity(intent);
}
} catch (JSONException e) {
e.printStackTrace();
}
}