Android Question Return Checkbox Value as string.

ElliotHC

Active Member
Licensed User
I have a save config routine which looks at the state of some checkboxes along with some textfield values and saves them to a file.

Text is saving fine but for some reason I can't seem to get the checkbox value.. It always returns false even when it's ticked.

Elsewhere in my code I'm using an if statement e.g.

B4X:
If Checkbox1.checked = True then
'DO CODE HERE
End If

This is working fine.

But when I do this

B4X:
Writer.Writeline("CheckBox Value," & CheckBox1.Checked)

I always write false
 

emexes

Expert
Licensed User
Edit: ignore this question - I was not aware that the issue had been resolved in another thread.

Where I was heading was that if the "&" somehow slipped through to the Java intermediate code as a boolean AND operator rather than a string concatenation operator, then the output might well just be the word "false" rather than "CheckBox Value,True"... which would have been mighty interesting ;-)


when I do this
B4X:
Writer.Writeline("CheckBox Value," & CheckBox1.Checked)
I always write false
Just in case the impossible is happening: what precisely is that WriteLine writing (the entire line, from start to end)?
 
Last edited:
Upvote 0
Top