How to create a dialog to show loading in android? I want to show a dialog with "Loading..." while an aynctask i running. I tried with an activity with Theme.Dialog
. Please help.
my code:
private class getlisttask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... arg0) {
SourceURL srcGrabber = new SourceURL ();
String result = "";
try {
Url = Url + usr + "&qry=" + query;
result = srcGrabber.grabSource(Url);
} catch (Exception e) {
Log.e("Exception", e.tostring());
}
return result;
}
@Override
protected void onPostExecute(String result) {
TextView txtView1 = (TextView) findViewById(R.id.TextView);
txtView1.setText(result);
}
}