In my project, I need to start a progress dialog
in one activity and need to stop it in an another activity. Here is my code.
progress.setMessage("Searching... ");
progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progress.setIndeterminate(true);
progress.show();
Intent intent = new Intent(mContext,BirdsAlgorithm.class );
intent.putExtras(bundle);
startActivity(intent);
I need to stop this progress bar in BirdsAlgorithm
class. How can I do this?
You have two options:
make progress static and public and then in next activity access it through the class name and then stop it.
override on destroy and on stop method for activity and then on stop and on destroy stop your progress