user1938357
user1938357

Reputation: 1466

allow user to enter checkbox text via xml or code

I have an activity with four checkboxes in it in a typical quiz format. I am trying to allow user to to edit the question(check box text) and check the check boxes he/she wishes to. Any suggestions on how to do this?

one of my four checkboxes are currently like this

<CheckBox
    android:id="@+id/checkBox1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:editable="true"
    android:text="type answer 1 here. Select check box if this is the right answer" />

Upvotes: 0

Views: 45

Answers (1)

oxygen0211
oxygen0211

Reputation: 98

I don't know if I got your Question right. You want to let the user change the Label of the Checkbox during runtime, right?

For this case I would suggest to add entry methods (for example TextViews) to an "edit" form and set the corresponding checkbox's text via checkbox.setText().

I hope this is an answer which helps you.

Upvotes: 1

Related Questions