Android Button Change Image change for Click event using XML Selector. like this.
StartButtonSelector.XML
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/start_button_pushed" />
<item android:drawable="@drawable/start_button" />
</selector>
and Layout XML File like this.
main_activity.xml
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/startButton"
android:layout_marginBottom="10dp"
android:layout_marginTop="8dp"
android:background="@drawable/start_btn_selector"/>
Now. i'm plan to use Picasso Image Library for Image caching. to avoid Out.of.Memory Error. So this is my scenario. how to do this. Thanks in Advance.