Issue with Custom Actionbar
iamohd-zz opened this issue · comments
Hi,
When I enter an activity that has fading actionbar and then open other activities, the custom action bar is not showing correctly. I mean it doesn't apply the custom style and it shows it as a regular Holo Light Theme.
This problem happens only if I enter any activity that has fading actionbar first.
Use actionBarBackground(Drawable drawable) instead of actionBarBackground(int drawableResId).
because getDrawable(int id) was deprecated in api level 22.
public void initActionBar(Activity activity) {
if (mActionBarBackgroundDrawable == null) {
mActionBarBackgroundDrawable = activity.getResources().getDrawable(mActionBarBackgroundResId);
}
setActionBarBackgroundDrawable(mActionBarBackgroundDrawable);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
mActionBarBackgroundDrawable.setCallback(mDrawableCallback);
}
mActionBarBackgroundDrawable.setAlpha(0);
}