I want to show ProgressDialog when http connection request.
there is request method.
protected Result request(String urlStr, String postData) {
ProgressDialog dialog = ProgressDialog.show(activity, "", "Loading...",true);
Result result = new Result();
String message = "";
try {
message = HttpRequest.postURL(urlStr, postData);
result = new Result(message);
} catch (Exception e) {
Log.e(TAG,"Failed to request data from " + urlStr + "\n" + e.getMessage());
}
dialog.dismiss();
return result;
}
but when this method running. the ProgressDialog not showing. how to solve this problem?