I'm creating an application that sends many requests to server from several Activity a fragment. i want to show ProgressDialog in request send methods, in this case, I want to write one time a code to show ProgressDialog and I don't want to write show progress dialog for every request.
this is my DataAccess Class for Connect to the server and send a request that every request use this class
public class DataAccess {
private static AsyncHttpClient client = new AsyncHttpClient();
public static void get(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
client.get(getAbsoluteUrl(url), params, responseHandler);
}
public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
client.post(getAbsoluteUrl(url), params, responseHandler);
}
private static void start() {
}
private static String getAbsoluteUrl(String relativeUrl) {
return Settings.serverLink + relativeUrl;
}
}
Can I show ProgressDialog in this Class?