Android Question Call button click

anaylor01

Well-Known Member
Licensed User
Longtime User
Can you call a button click? I have tried the three below ways and one of them seem to work.
btnSaveSettings_Click
CallSub(Main,"btnSaveSettings_Click")
CallSub("","btnSaveSettings_Click")
 

anaylor01

Well-Known Member
Licensed User
Longtime User
I think I am doing the IME action wrong. I am trying to call the button click when the user clicks done on the soft keyboard.
B4X:
Sub IME_HandleAction As Boolean
    Msgbox("done button","donebutton")
' btnSaveSettings_Click
  CallSub("Main","btnSaveSettings_Click")
End Sub
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
You should be able to call the sub directly. Have you added an action handler for the IME ?

try this ...

B4X:
IME.Initialize("IME")
IME.AddHandleActionEvent(EditText1)   'your input view

Sub IME_HandleAction As Boolean  
   btnSaveSettings_Click
End Sub

Sub btnSaveSettings_Click
   Log( "Button has been Clicked")
End sub
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
Here is what I have and it isn't working. It doesn't do anything after I click done on the keyboard. Well the keyboard closes and thats it.
B4X:
Sub SetKeyboard
    IME.Initialize("IME")
    DoEvents
IME.ShowKeyboard(edtGameName)
IME.AddHandleActionEvent(edtGameName)
End Sub


Sub IME_HandleAction As Boolean 
   btnSaveSettings_Click
End Sub
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Here is what I have and it isn't working. It doesn't do anything after I click done on the keyboard.

Your code works fine here .. All I can suggest is check the spelling of btnSaveSettings_Click
Maybe insert a Log call in IME_HandleAction sub to confirm its working ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…