<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false"
android:drawable="@drawable/widget_bg_normal"/> <item android:state_focused="true"
android:drawable="@drawable/widget_bg_selected"/> <item android:state_pressed="true"
android:drawable="@drawable/widget_bg_pressed"/> <item android:drawable="@drawable/widget_bg_normal"/> </selector>
The Drawable resources referenced should be stored, along with the selection state xml file, in the application's res/drawable folder. You can then use the Selection State Drawable directly as the source for an Image View, or as the background image for any widget View.
Available for download on Wrox.com
Was this article helpful?
Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.