views:

188

answers:

2

I have an image button as defined below.

<ImageButton 
    android:text="Play"
    android:src="@drawable/playpause"
    android:background="@drawable/opaque" 
    android:gravity="center_horizontal"
    android:id="@+id/player_ctrl_btn"
    android:layout_width="fill_parent" 
    android:padding="0px"
    android:layout_height="wrap_content" />

I want to set the default state of the button to be selected. So in code I would say:

playBtn.setSelected(true);

Is it possible to do this in xml?

+1  A: 

It doesn't look like you can -- sorry!

CommonsWare