I\'m retrieving data from my server through JSON using Volley
JSONObjectRequest
to achieve this. After getting the JSON response, I want to save it int
You should declare status as int
instead of String
.
private int status=0;
You can try this way
status = response.getInt("status");
description = response.getString("description");
if (status == 1) {
checkingStatus(status);
} else {
checkingStatus(status);
}
Then
public void checkingStatus(int status){
if(status == 1){
// do your code
}else{
// do your code
}
}