Below is my code: that works fine but dialog not showing.Dialog should open with ASyncTask starts and dismiss with ends.how is is possible to do?
Public class RootClass
{
public ProgressDialog dialog;
public List methodA(String a)
----
----
Class childClass extends AsyncTask<Void,Void,Void>
{
@Override
protected void onPreExecute() {
dialog = ProgressDialog.show(RootClass.this,"Please wait", "Message");
}
@Override
protected Void doInBackground(Void... params) {
----
---
---
List<String> B=methodA(String a);
-----
-----
}
@Override
protected void onPostExecute(Void result) {
dialog.dismiss();
return;
}
}
}</pre>