Android Question When a value changes speaks

Discussion in 'Android Questions' started by Isac, Feb 3, 2015.

  1. Isac

    Isac Active Member Licensed User

    Hi friends B4A,

    The Label4 automatically acquires a value and when
    this value changes I would make him talk, but currently is not talking.
    Maybe I have to memorize it and then compare it to?

    If Label4.Text.Length > 0 OR Label4.Text<> Label4.Text  Then

    thank you
  2. Cableguy

    Cableguy Expert Licensed User

    Don't use a Label. Use an Edit text view and put your ts inside the text changed event.
    you will need extra coding to prevent user input.
    Isac likes this.
  3. Troberg

    Troberg Well-Known Member Licensed User

    I assume that you are setting the label from many places in your code, as you don't want to simply call it from there.

    My suggestion would be to add a sub to set the label and speak if need be:

    Sub SetTTSLabel(Text as string)
    If Label4.Text<>Text Then
    If Text<>"" Then
    End If
    End If
    End Sub
    Then, simply, use


    instead of


    everywhere you change the value of Label4 (except, of course, in SetTTSLabel).
    Isac and Cableguy like this.
  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