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;
class YourTask extends AsyncTask<Void, Void, Void> {
protected void onPreExecute() {
dialog = ProgressDialog.show(...);
}
protected Void doInBackground(Void... unused) {
try {
// doSomethingHeavy();
// publishProgress(...);
} catch(Exception e) {
//...
}
return null;
}
protected void onProgressUpdate(Void... unused) {
}
protected void onPostExecute(Void unused) {
dialog.dismiss();
}
}
Solution 2:
You sure can. Check out the AsyncTask and this tutorial for inspiration.
Post a Comment for "ProgressBar Betweed Activities"