MaterialDesignLibrary icon indicating copy to clipboard operation
MaterialDesignLibrary copied to clipboard

setChecked not working

Open ateodor1 opened this issue 10 years ago • 11 comments

I'm trying to set the CheckBox to checked using myCheckBox.setChecked(true) but it is always not checked when the screen is loaded. Can you please check ?

Thanks.

ateodor1 avatar Jan 26 '15 11:01 ateodor1

Hi, I've seen the error, Does the error happen when you call the myCheckBox.setChecked(true) function in the onCreate function?

navasmdc avatar Jan 30 '15 18:01 navasmdc

Exactly, I called during the onCreate function.

ateodor1 avatar Jan 30 '15 18:01 ateodor1

Okay, I'm going to fix it!!

navasmdc avatar Jan 30 '15 18:01 navasmdc

Great! Tks !!

ateodor1 avatar Jan 30 '15 18:01 ateodor1

I have the same error calling to setChecked() from RecyclerView.onBindViewHolder

jdzuri avatar Feb 27 '15 16:02 jdzuri

For me the same. Calling setChecked() from getView() - BaseAdapter - not working properly. But by flipping some pages, its set yet.

Hope you know how to fix. Thanks

gsus24 avatar Feb 28 '15 20:02 gsus24

Love the library, but this setChecked issue is a deal breaker for me, it is so basic, can't believe it is not working. Please fix.

sivag1 avatar Mar 13 '15 21:03 sivag1

+1, this really needs to be fixed.

alokedesai avatar Mar 13 '15 23:03 alokedesai

Hello,any update on this? Anyone found a temporary workaround while it gets fixed?

EDIT: It seems like it's a problem with threads. By reviewing the code, I found a way to make it work (it's a bit hacky, just as a temporary solution until it gets fixed) Call: setChecked(myCheckBox,checked);

And implement: void setChecked(final CheckBox cb, final boolean checked){ cb.post(new Runnable() { @Override public void run() { cb.setChecked(checked); } }); }

Bruno125 avatar Mar 18 '15 04:03 Bruno125

Needs to get fixed, pls + 1

Jdruwe avatar May 19 '15 12:05 Jdruwe

Needs to get fixed, pls + 1

heiyeliuying avatar Jan 05 '16 02:01 heiyeliuying