Bug? FocusChanged on EditText doesnot fire when moving to aButton.

Discussion in 'Bugs & wishlist' started by MrKim, Jan 20, 2015.

  1. MrKim

    MrKim Active Member Licensed User

    B4A Version 4.
    FocusChanged event fires when moving from one EditText to another, but if you move from an EditText to a Button the FocusChanged event for the EditText NEVER fires. Not before OR after the Button_Click Event.
     
  2. stevel05

    stevel05 Expert Licensed User

    On a device without a keyboard or other control method, the Focus does not leave the EditText when you press the button. That is the expected behaviour See the section on TouchMode on this page: http://developer.android.com/reference/android/view/View.html.

    If it is important to you, it is possible to set the button to accept the focus in touch mode using JavaObject

    Code:
    Dim JO As JavaObject = Button1
        JO.RunMethod(
    "setFocusableInTouchMode",Array(True))
    The button will then be highlighted (Focused) when you leave the EditText and the EditText Focus changed event will fire.
     
    DonManfred likes this.
  3. MrKim

    MrKim Active Member Licensed User

    Thanks for that. I solved it another way, just run the focus code in the button click event. Just wanted to report what I thought was a bug.
     
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