I have seen two ways to set background for Android App screen.
case A:: android:background=”?attr/actionBarItemBackground”
case B:: android:background=”@drawable/ic_launcher_settings”
How do android:background functions in the case A? I searched code, but not able to figure out where “actionBarItemBackground” exists. I understood case B
Case A is a reference to a style attribute. It allows you to reference a particular piece of style information without knowing its actual value. There are a lot of Android-defined attributes that are used to style the Android UI, but you can also define you own attributes.
actionBarItemBackgroundis one such attribute. There are two ways you can use this attribute:You can reference it to make the look and feel of UI elements consistent with action bar items:
You can define a theme and set the value of this attribute to override the default L&F for your app:
Here are some pointers to the Android documentation:
For styles an themes see:
http://developer.android.com/guide/topics/ui/themes.html.
For a list of all attributes see:
http://developer.android.com/reference/android/R.attr.html
For defining your own attributes there is no documentation. Have a look at one of the
attrs.xmlfiles in the SDK (e.g. underplatforms\android-17\data\res\values) to see how style attributes are declared. You can declare attributes in the same way by putting anattrs.xmlfile in yourres\valuesfolder. You can then use these attributes in your own styles and themes.