Drawable.setState () Wie steuere ich den spezifischen Status des Drawable?

Ich habe eine Zeichnung wie diese:

<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true"
      android:state_window_focused="true"
      android:drawable="@drawable/seek_thumb_pressed" />

<item android:state_focused="true"
      android:state_window_focused="true"
      android:drawable="@drawable/seek_thumb_selected" />

<item android:state_selected="true"
      android:state_window_focused="true"
      android:drawable="@drawable/seek_thumb_selected" />

<item android:drawable="@drawable/seek_thumb_normal" />

Wie lege ich im Code den spezifischen Status meines Drawable fest? Ich möchte es auf den Zustand state_pressed = true setzen.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage