I am creating a dynamically Imageview.
ImageView btnSend = new ImageView (this);
I need to put a layout that contains the states of the images, this is the xml:
<? xml version = "1.0" encoding = "utf-8"?>
<selector
xmlns: android = "http://schemas.android.com/apk/res/android">
<item
android: state_focused = "true"
android: state_pressed = "false"
android: drawable = "@ drawable/button_state3" />
<item
android: state_focused = "true"
android: state_pressed = "true"
android: drawable = "@ drawable/button_state2" />
<item
android: state_focused = "false"
android: state_pressed = "true"
android: drawable = "@ drawable/button_state2" />
<item
android: drawable = "@ drawable/button_state1" />
</ selector>
I tested with setBackgroundResource property, but does not work.
how do I assign this layout to Imageview?
Thanks in advance.