Android Question Return Checkbox Value as string.

Discussion in 'Android Questions' started by ElliotHC, Aug 8, 2019.

  1. ElliotHC

    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.

    Code:
    If Checkbox1.checked = True then
    'DO CODE HERE
    End If
    This is working fine.

    But when I do this

    Code:
    Writer.Writeline("CheckBox Value," & CheckBox1.Checked)
    I always write false
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The problem is somewhere else. Checbox.Checked will return True or False based on the value. It will be converted to string automatically.
     
  3. emexes

    emexes Well-Known Member 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 ;-)


    Just in case the impossible is happening: what precisely is that WriteLine writing (the entire line, from start to end)?
     
    Last edited: Aug 8, 2019
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice