android - RadioGroup checkedButton property -
i trying build radiogroup in android 1 radiobutton checked default. i'm wondering if possible through xml, rather programmatically.
the following code snippet doesn't seem work i'm getting error:
error: error: no resource found matches given name (at 'checkedbutton' value '@id/rdb_positive')
the code is:
<radiogroup style="@style/forminputfield" android:orientation="vertical" android:checkedbutton="@id/rdb_positive"> <!-- error on line --> <radiobutton android:id="@+id/rdb_positive" android:text="@string/answer_positive" /> <radiobutton android:id="@+id/rdb_negative" android:text="@string/answer_negative" /> </radiogroup>
it make sense in way, id of radiobutton defined after attribute in radiogroup set, wonder why there such attribute available.
use android:checkedbutton="@+id/rdb_positive"
,i think add +
sign works
Comments
Post a Comment