Progressbar Betweed Activities
I have two activities. The first one executes the second one. Intent i = new Intent(MyOne.this, MyTwo.class); startActivity(i); The problem: My second activit
Solution 1:
I suggest you to do this asynchronously using AsyncTask.
Short example:
ProgressDialog dialog;
classYourTaskextendsAsyncTask<Void, Void, Void> {
protectedvoidonPreExecute() {
dialog = ProgressDialog.show(...);
}
protectedVoiddoInBackground(Void... unused) {
try {
// doSomethingHeavy();// publishProgress(...);
} catch(Exception e) {
//...
}
returnnull;
}
protectedvoidonProgressUpdate(Void... unused) {
}
protectedvoidonPostExecute(Void unused) {
dialog.dismiss();
}
}
Post a Comment for "Progressbar Betweed Activities"