T techgreyeye Member Licensed User Longtime User Aug 9, 2019 #1 In one of my projects, I have an activity which lists products in a custom list view. When a button is tapped in the list, a panel is made visible which contains an ACSpinner and an ACEditText, the idea being the user selects a size from the spinner, then enters a number of items in the text. I open the spinner using this code Code: Dim r As Reflector r.Target = spnCountSizes r.RunMethod("performClick") This all works as expected. When the spinner value is selected, I want to move the focus to the ACEditText, so I have this : Code: Sub spnCountSizes_ItemClick(pos As Int, my_val As Object) IME1.SetCustomFilter(edtCountQuantity, edtCountQuantity.INPUT_TYPE_DECIMAL_NUMBERS,"01234567890.-") IME1.ShowKeyboard(edtCountQuantity) End Sub The trouble is, the first time I select a value in the spinner, the keyboard doesn't show. If I tap the spinner and pick a value again, the keyboard does show. I've tried various different combinations of setting focus on other views first, using edtCountQuantity.RequestFocus, remove the custom keyboard filter, using sleep and even DoEvents (the horror...) but nothing seems to work. Does anybody have any idea what I'm doing wrong? Thanks, Darren
In one of my projects, I have an activity which lists products in a custom list view. When a button is tapped in the list, a panel is made visible which contains an ACSpinner and an ACEditText, the idea being the user selects a size from the spinner, then enters a number of items in the text. I open the spinner using this code Code: Dim r As Reflector r.Target = spnCountSizes r.RunMethod("performClick") This all works as expected. When the spinner value is selected, I want to move the focus to the ACEditText, so I have this : Code: Sub spnCountSizes_ItemClick(pos As Int, my_val As Object) IME1.SetCustomFilter(edtCountQuantity, edtCountQuantity.INPUT_TYPE_DECIMAL_NUMBERS,"01234567890.-") IME1.ShowKeyboard(edtCountQuantity) End Sub The trouble is, the first time I select a value in the spinner, the keyboard doesn't show. If I tap the spinner and pick a value again, the keyboard does show. I've tried various different combinations of setting focus on other views first, using edtCountQuantity.RequestFocus, remove the custom keyboard filter, using sleep and even DoEvents (the horror...) but nothing seems to work. Does anybody have any idea what I'm doing wrong? Thanks, Darren
Erel B4X founder Staff member Licensed User Longtime User Aug 11, 2019 #2 Why aren't you using B4XPrefernecesDialog for this? It will be simpler. Upvote 0