Created
April 6, 2018 17:08
-
-
Save MateusAndreatta/279ae241cef637e1f8f6102edcbe18f9 to your computer and use it in GitHub Desktop.
Base de volley
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dialog para dar um feedback ao usuario | |
progressDialog.setMessage(getResources().getString(R.string.loadingRegistros)); | |
progressDialog.show(); | |
// string request | |
StringRequest stringRequest = new StringRequest(Request.Method.POST, JSON_URL, | |
new Response.Listener<String>() { | |
@Override | |
public void onResponse(String response) { | |
// tirar o dialog | |
progressDialog.dismiss(); | |
} | |
}, | |
new Response.ErrorListener() { | |
@Override | |
public void onErrorResponse(VolleyError volleyError) { | |
//tirar o dialog | |
progressDialog.dismiss(); | |
} | |
}) { | |
@Override | |
protected Map<String, String> getParams() { | |
// Creating Map String Params. | |
Map<String, String> params = new HashMap<String, String>(); | |
// Adding All values to Params. | |
params.put(/*"name do php"*/, /*Valor*/); | |
return params; | |
} | |
}; | |
requestQueue.getCache().clear(); | |
requestQueue.add(stringRequest); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment