In the case I want to know how to get only the value of the GET of the link "... / possess_cadastro" to enter the If or Else.
public class LoginRequest extends StringRequest {
private static final String REGISTER_REQUEST_URL = "http://192.168.30.12:5000/possui_cadastro";
private Map<String, String> params;
public LoginRequest(Response.Listener<String> listener) {
super(Method.GET, REGISTER_REQUEST_URL, new Response.Listener<String>()
{
@Override
public void onResponse(String response) {
// display response
if (response.toString() == "1") {
Context mContext = null;
Intent intent = new Intent(mContext, GpsActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
}
else {
Context mContext = null;
Intent intent = new Intent(mContext, RegisterActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("Error.Response", String.valueOf(error));
}
});