R RMarra Member Licensed User Longtime User Jul 28, 2019 #1 I am trying to have the keyboard pop up automatically on a textbox. Here is my code: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Calculator") Units.Text = "" If Glucose.RequestFocus Then Dim Keybd As IME Keybd.Initialize("IME") Keybd.ShowKeyboard(Glucose) End If End Sub This works perfectly in Debug mode but the keyboard does not appear in Release mode.
I am trying to have the keyboard pop up automatically on a textbox. Here is my code: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Calculator") Units.Text = "" If Glucose.RequestFocus Then Dim Keybd As IME Keybd.Initialize("IME") Keybd.ShowKeyboard(Glucose) End If End Sub This works perfectly in Debug mode but the keyboard does not appear in Release mode.
Erel B4X founder Staff member Licensed User Longtime User Jul 29, 2019 #2 Please use [code]code here...[/code] tags when posting code. The correct way to start an activity with the keyboard opened is by adding this to the manifest editor: Code: Copy SetActivityAttribute(YourActivity, android:windowSoftInputMode, adjustResize|stateVisible) adjustResize or adjustPan based on your requirements. Upvote 0
Please use [code]code here...[/code] tags when posting code. The correct way to start an activity with the keyboard opened is by adding this to the manifest editor: Code: Copy SetActivityAttribute(YourActivity, android:windowSoftInputMode, adjustResize|stateVisible) adjustResize or adjustPan based on your requirements.
R RMarra Member Licensed User Longtime User Jul 29, 2019 #3 Thank you! That did it. Sorry about the tags around the code. I was not aware. Upvote 0
R RMarra Member Licensed User Longtime User Jul 29, 2019 #4 I still cannot get the keyboard to open when a specific view gets focus. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 29, 2019 #5 Add a log message and check whether View.RequestFocus actually returns True. Adding Sleep(100) before setting the focus might help. Upvote 0
Add a log message and check whether View.RequestFocus actually returns True. Adding Sleep(100) before setting the focus might help.
R RMarra Member Licensed User Longtime User Jul 29, 2019 #6 I think I just need to change my approach. What I'm trying to accomplish is making a required field. If the user presses "DONE" without keying a number, the view does not lose focus, but the keyboard closes. That's why I'm trying to force the keyboard to reappear. This is probably easy to do, but I'm not seeing it. Upvote 0
I think I just need to change my approach. What I'm trying to accomplish is making a required field. If the user presses "DONE" without keying a number, the view does not lose focus, but the keyboard closes. That's why I'm trying to force the keyboard to reappear. This is probably easy to do, but I'm not seeing it.
Erel B4X founder Staff member Licensed User Longtime User Jul 29, 2019 #7 This thread is a good example of how not to ask a question... RMarra said: . If the user presses "DONE" without keying a number, the view does not lose focus, but the keyboard closes. Click to expand... There is a way to do it however you should start a new thread and post the problem you are trying to solve in the first post. Upvote 0
This thread is a good example of how not to ask a question... RMarra said: . If the user presses "DONE" without keying a number, the view does not lose focus, but the keyboard closes. Click to expand... There is a way to do it however you should start a new thread and post the problem you are trying to solve in the first post.
R RMarra Member Licensed User Longtime User Jul 29, 2019 #8 My apology. In my mind, this is all the same question. Apparently I don't understand the protocol for asking questions. In the future, I'll just try to figure things out on my own until I get frustrated and give up on B4A. Upvote 0
My apology. In my mind, this is all the same question. Apparently I don't understand the protocol for asking questions. In the future, I'll just try to figure things out on my own until I get frustrated and give up on B4A.
Erel B4X founder Staff member Licensed User Longtime User Jul 29, 2019 #9 I tried to guess three times which problem you are trying to solve. This means that the question or problem, which should always appear in the first post didn't include enough information for us to help you. Anyway you should take a look in IME.AddHandleActionEvent. Upvote 0
I tried to guess three times which problem you are trying to solve. This means that the question or problem, which should always appear in the first post didn't include enough information for us to help you. Anyway you should take a look in IME.AddHandleActionEvent.
R RMarra Member Licensed User Longtime User Jul 29, 2019 #10 I'm sorry. You are right. I actually found another post about IME.AddHandleActionEvent and it is working nicely, in both debug and release. Upvote 0
I'm sorry. You are right. I actually found another post about IME.AddHandleActionEvent and it is working nicely, in both debug and release.