Checkbox android studio

Asked

Viewed 257 times

0

How can I show my checkbox already marked with code recovered value.

I was able to recover the value

checkBox1 = (CheckBox) view.findViewById(R.id.check1);

and saved in a var

if (checkBox1.isChecked()){
  check1InputLayout = "1";
  }else{
  check1InputLayout = "0";
  }

wanted to show in my XML the value true or false according to the check result

  • I don’t understand what you want... Display "1" or "0" as text from some control of your screen?

  • I need to show the check box marked when I retrieve my list

  • To mark the check box would be checkBox1.setChecked(true)

  • But to save this value I use statement or I can save in the database object?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.