Android - (Widget) State (Selected, )

Card Puncher Data Processing


An element state is implemented through a Drawable State List.

A StateListDrawable is a drawable object defined in XML that uses a several different images to represent the same graphic, depending on the state of the object.

See also: bundle stateSavedInstance


For example, a Button widget can exist in one of several different states:

  • pressed,
  • focused,
  • or neither

and, using a state list drawable, you can provide a different background image for each state.

Share this page:
Follow us:
Task Runner