вызывает следующее исключение.
Если вы не объявляете состояние по умолчанию, тогда селектор не работает для меня. Поэтому я поместил одно прозрачное изображение в состояние по умолчанию, и оно работает для меня.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/image" android:state_pressed="true"></item>
<item android:drawable="@drawable/image" android:state_selected="true"></item>
<item android:drawable="@drawable/image" android:state_focused="true"></item>
<item android:drawable="@drawable/imagetrans"/>
</selector>
Использование: -
<TextView
android:id="@+id/txtobject"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:clickable="true"
android:drawableRight="@drawable/selector"
android:focusableInTouchMode="true"
android:text="@string/object"
android:textSize="25sp" />