问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/24823029/progressbar-in-actionbar-on-android-l-preview