I am using Action Bar Compat so that my action bar with navigation drawer was backward compatible down to API level 9 and I want to change the background of the action bar.
I am currently working on the same task.
Here is my action_bar_bg.xml file in which I define the gradient for my action bar.
DeadObjectException
android:shape="line"
can't be used if there is a gradient inside. I tested it; my Samsung Galaxy Note 10.1 N8000 restarted, and there was a DeadObjectException
.
The linear
type of gradient pattern is the default value. So you don't have to declare it explicitly.
Here is my styles.xml
in the values folder.
Gradient Drawable