I have a problem which happens when my users register with mysql.
When a username and password are registered, the app must show the message "User created successfully".
But the app doesn't show any message and instead closes itself.
The username has been inserted into the database.
It gives me the same problem even when I send empty data.
This my PHP response
$response["success"] = 1;
$response["message"] = "Username Successfully Added!";
echo json_encode($response);
This is my register Java code
Log.d("Login attempt", json.toString());
// json success element
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
Log.d("Username Successfully Added!", json.toString());
finish();
return json.getString(TAG_MESSAGE);
}else{
Log.d("Login Failure!", json.getString(TAG_MESSAGE));
return json.getString(TAG_MESSAGE);
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}