I am unable to stop a ProgressBar
. Its style is ProgressBarStylesmall
. How can I start and stop a circular, small ProgressBar
?
By default you can make progressBar visible and hide it when not needed like this:
progressBar.setVisibility(View.GONE);
If you want to control it programatically then you can achieve that with:
progressBar.setVisibility(View.VISIBLE); //to show
progressBar.setVisibility(View.GONE); // to hide
You can even go with ProgressDialog:
private ProgressDialog progressDialog;
...
public void showProgressDialog() {
if (progressDialog == null) {
progressDialog = new ProgressDialog(PhotographerDetailActivity.this);
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(false);
}
progressDialog.setMessage("your message");
progressDialog.show();
}
public void dismissProgressDialog() {
if (progressDialog != null ) {
progressDialog.dismiss();
}
Hope it will help you.