Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProgressBar in ActionBar on Android L Preview

Today I started porting an app to Android L preview in order to have it almost ready when the final product launches. One problem I found is that I can't have an indeterminate progressbar on the ActionBar. It doesn't show at all and throws this error on logcat:

E/PhoneWindow﹕ Circular progress bar not located in current window decor

I'm using this code, which works in <4.4:

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);

Is there any way to get it working again in Android L or should I use an external ProgressBar?

like image 735
Jorge Martín Avatar asked Jul 18 '14 10:07

Jorge Martín


People also ask

What is ProgressBar in android?

Android ProgressBar is a graphical view indicator that shows some progress. Android progress bar displays a bar representing the completing of the task. Progress bar in android is useful since it gives the user an idea of time to finish its task.

What is indeterminate ProgressBar?

Android ProgressBar Indeterminate ProgressBar An indeterminate ProgressBar shows a cyclic animation without an indication of progress.


1 Answers

I've just found this question and checked the bug report.

It seems that the dev team had concluded that the issue won't be fixed.

That is:

intended as the progress bar features are not supported on Material action bars.

The "Material action bar" should mean 4.4 (API19) or later's action bar.

like image 174
hata Avatar answered Oct 13 '22 08:10

hata