Android Question EditText_FocusChanged Never Fires - Solved

RichardN

Well-Known Member
Licensed User
Longtime User
I am recompiling a single Activity, single screen calculator I wrote a few years ago following some minor modifications. The platform is a Samsung S21 Ultra running Android 13. TargetSdkVersion="31". The FocusChanged event for the edit text never fires.... not in Debug nor Release modes ????

B4A:
Sub Globals
    Private txtPatternInclude As EditText   
End Sub
.
.
.
Private Sub txtPatternInclude_FocusChanged (HasFocus As Boolean)          'Sub never fires
    Log("I am here")
    ToastMessageShow("I am here",True)
End Sub

There are some code snippets on the forum that use the Reflection library to make the View focusable but they appear well out of date and don't work. I am sure I will be told to use B4Xpages once again but porting the code over is too time consuming for very little benefit. Is there a solution to getting the FocusChanged event to fire?
 

RichardN

Well-Known Member
Licensed User
Longtime User
Hi @klaus I appreciate that.

The error has been traced to a corrupt .bal file that produced the event name conflict. All working as advertised now. :)
 
Last edited:
Upvote 0
Solution
Top