-4
これは私のサーバーから取得したJSONデータです{"成功": "メッセージ": "ありがとうございました"}。このを成功から抽出します。私はどうすればこのようにしてください助けてください。 success
フィールドは、あなたがこのようにそれを読むためにInteger
ないJsonObject
必要されJSONで特定の情報を取得する方法
@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();
}
}
使用reader.getInt( "成功"); –