Here is my simple AsyncTask :
class MyTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... params) {
String page = null;
try {
page = new Communicator().executeHttpGet(params[0]);
} catch (Exception e) {
e.printStackTrace();
}
return page;
}
how do I add a progress bar to this that displays a simple spinner? Every time I try the code breaks or parameters are misplaced.
EDIT:
class MyTask extends AsyncTask<String, Void, String> {
ProgressDialog myPd_ring = null;
@Override
protected void onPreExecute() {
myPd_ring.show();
}
@Override
protected String doInBackground(String... params) {
String page = null;
try {
page = new Communicator().executeHttpGet(params[0]);
} catch (Exception e) {
e.printStackTrace();
}
return page;
}
@Override
protected void onPostExecute(String result) {
myPd_ring.dismiss();
super.onPostExecute(result);
}
}
Tried this still doesn't work ! In fact the application isn't even responding to standard input now ! Thanks !