B boastrike Member Licensed User Longtime User Jan 3, 2012 #1 I have been reading the threads on the issues with FocusChanged on edittexts. I'm running into an issue where I have an edittext field and a listview along with a couple of buttons. The process is basically a user enters some data into the edit text field and it adds a row to the listview. The issue doesn't appear until the user processes the data they have entered which consists of creating a CSV file and sends it on its way. The problem comes when the app calls listview.clear and it generates a call to the edittext_focuschanged for some reason. It sets the HasFocus to true and then the edittext field no longer responds to the user when you touch/tap on the field to enter new data into the text field. It seems to be stuck on true. I can touch/tap on other buttons and they respond but nothing doing with the edittext. I was hoping I could force the HasFocus to false so it would be ready to respond but so far no luck. Any hints to resolving this would be most helpful. I'm working to create a small app that duplicates this but have not gotten it yet. Thanks, boa
I have been reading the threads on the issues with FocusChanged on edittexts. I'm running into an issue where I have an edittext field and a listview along with a couple of buttons. The process is basically a user enters some data into the edit text field and it adds a row to the listview. The issue doesn't appear until the user processes the data they have entered which consists of creating a CSV file and sends it on its way. The problem comes when the app calls listview.clear and it generates a call to the edittext_focuschanged for some reason. It sets the HasFocus to true and then the edittext field no longer responds to the user when you touch/tap on the field to enter new data into the text field. It seems to be stuck on true. I can touch/tap on other buttons and they respond but nothing doing with the edittext. I was hoping I could force the HasFocus to false so it would be ready to respond but so far no luck. Any hints to resolving this would be most helpful. I'm working to create a small app that duplicates this but have not gotten it yet. Thanks, boa
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2012 #2 The keyboard doesn't appear when the user clicks on the EditText? Upvote 0
B boastrike Member Licensed User Longtime User Jan 4, 2012 #3 Erel, No it doesn't as I have the edtitem set to not accept text in the Activity_Create because I display a custom keyboard if they click on the field. Code: Copy edtItem.InputType = edtItem.INPUT_TYPE_NONE As I debug it, it is when the line lvItemList.Clear is called. Could it have something to do with the index of the edittext and listview views? The problem doesn't start happening until after returning from the email intent. In debug it shows that HasFocus is true already and the focuschanged event for the edtitem does get called and the boolean set during the execution of the lvItemList.Clear. I've placed requestfocus to another view to no help. If I change the orientation of the device and back it does reset the hasfocus boolean however. Code: Copy Sub edtItem_FocusChanged (HasFocus As Boolean) If HasFocus Then pnlKeyboard.Visible = True End If End Sub Thanks, Boa Upvote 0
Erel, No it doesn't as I have the edtitem set to not accept text in the Activity_Create because I display a custom keyboard if they click on the field. Code: Copy edtItem.InputType = edtItem.INPUT_TYPE_NONE As I debug it, it is when the line lvItemList.Clear is called. Could it have something to do with the index of the edittext and listview views? The problem doesn't start happening until after returning from the email intent. In debug it shows that HasFocus is true already and the focuschanged event for the edtitem does get called and the boolean set during the execution of the lvItemList.Clear. I've placed requestfocus to another view to no help. If I change the orientation of the device and back it does reset the hasfocus boolean however. Code: Copy Sub edtItem_FocusChanged (HasFocus As Boolean) If HasFocus Then pnlKeyboard.Visible = True End If End Sub Thanks, Boa
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2012 #4 You can handle the Click event of EditText. It doesn't appear in the list of events but all views support it. Upvote 0
You can handle the Click event of EditText. It doesn't appear in the list of events but all views support it.
B boastrike Member Licensed User Longtime User Jan 5, 2012 #5 Erel, Thank you very much! Adding the event cured my issue. Kudos to your efforts and dedication to not only the product advancement but to your user community. Thanks! :sign0188: Upvote 0
Erel, Thank you very much! Adding the event cured my issue. Kudos to your efforts and dedication to not only the product advancement but to your user community. Thanks! :sign0188: