You can achieve this with the AsyncTask class.
In these three steps you must follow,
- you need to run ProgreesDialog in
onPreExecute(). doInBackground() takes charge of the boot process.onPostExcecute()starts after the second step. on this you can reject your progress dialog, start a new activity and end your surge.
, . .
:
private class Task extends AsyncTask<Void, Void, Void> {
private final ProgressDialog dialog = new ProgressDialog(
your_class.this);
protected void onPreExecute() {
this.dialog.setMessage("Loading...");
this.dialog.setCancelable(false);
this.dialog.show();
}
@Override
protected Void doInBackground(Void... params) {
try {
} catch (Exception e) {
}
return null;
}
protected void onPostExecute(Void result) {
if (this.dialog.isShowing()) {
this.dialog.dismiss();
}
}
}