OnExit event in editText?

2

I'm looking for an event called onExit in editText , but I found none.

What I want to do is add a function when leaving the field.

Ex 1: The user is using a bluetooth barcode reader and when he reads the code, the reader already moves to another field (with TAB set in the barcode reader) and already loads the data related to that code.

Ex 2: When adding the CEP when the user selects another field the system already automatically loads others without pressing any button.

Ex. In code: Change the "translateButton" button for the editText and the "Click" event to what I did not realize is the "onExit".

translateButton.Click += (object sender, EventArgs e) => 
{
    Core.PhonewordTranslator.ToNumber(phoneNumberText.Text);   // Translate user's alphanumeric phone number to numeric translatedNumber =
    if (String.IsNullOrWhiteSpace(translatedNumber)) 
        { 
            callButton.Text = "Call"; callButton.Enabled = false; 
        } 
    else 
        { 
            callButton.Text = "Call " + translatedNumber; callButton.Enabled = true; 
        } 
};

If anyone knows something like this, please help me.

    
asked by anonymous 09.06.2016 / 14:29

2 answers

0

In xamarin forms Entry has an event called Unfocused so you can implement the function field.Unfocused + = (object sender, FocusEventArgs e) = > {   //to implement } If you have Xamarin Forms, you certainly have it for Android.

    
13.06.2016 / 23:24
0

I would use the Android attribute itself, the FocusChangeListener . In Xamarin, you can put something like this:

translateButton.FocusChange += (sender, e) => {
  if ( e.HasFocus ) {
    //ganhou foco
  }
  else {
    //perdou o foco
  }
}
    
09.05.2017 / 20:51