I am Woking on an android application where I am very interested to use volley
library to perform the network http calls.
But my question I found that this library do operations in different background thread then How I can showProgressDialog
when http request start to execute then later dismiss it once it has executed.
RequestQueue rq = Volley.newRequestQueue(this);
StringRequest postReq = new StringRequest(Request.Method.POST, "http://httpbin.org/post", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
tv.setText(response); // We set the response data in the TextView
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error ["+error+"]");
}
});
Thanks in advance.