Android Question Sub EditText1_TextChanged inside Button1_Click

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

  1. Isac

    Isac Active Member Licensed User

    tts1.Speak(EditText1.Text,True)I want him to talk when I press the button, I have trouble moving the sub in the button.
    I would call this sub inside the button.

    thank you

    Code:
    Sub EditText1_TextChanged (Old As String, New As String)
        
    If EditText1.Text.Length > 0 AND EditText1.Text <> Old  Then
        tts1.Speak(EditText1.Text,
    True)
        
    End if

    [CODE]
    Sub Button1_Click

     
    EditText1_TextChanged (Old 
    As String, New As String)

    End Sub
     
    Last edited: Feb 5, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Code:
    EditText1_TextChanged("", EditText1.Text)
     
    Isac likes this.
  3. eurojam

    eurojam Well-Known Member Licensed User

    Code it like this - put your speak in a routine and call it:
    Code:
    Sub speak (s As String)
       tts1.speak(s,
    True)
    End Sub
    Sub EditText1_TextChanged (Old As String, New As String)
        
    If EditText1.Text.Length > 0 AND EditText1.Text <> Old  Then
         speak(EditText1.Text)
        
    End If
    End Sub
    Sub Button1_Click
      speak(EditText1.Text)

    End Sub
    Stefan
     
    Isac likes this.
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