How to detect when keyboard pop-up in webview

pluton

Active Member
Licensed User
Longtime User
I don't know if the title of question is correct but you all will understand my problem.

In my app I have loaded webview from my external site and in that web view user must fill some form.

When user touch form field in WebView it automaticly pop-up android keyboard and user can type in it.
How can I detect when keyboard pop-up.
The reason what I ask is because I want to enter custom keyboard to show or at least to detect when keyboard is pop-up and move my webview UP so don't be covered with keyboard.

I have looked IME example but in that example keyboard was detected and showed on click of button.
In example of custom keyboards it all raised custom keyboard on click of edit texts in app.

But in my app the user touch form field in webview :(


Here is example image:
keyboard.png
 

pluton

Active Member
Licensed User
Longtime User
Thank you Erel

Your answer was very helpful

It works :) :sign0188:

B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim ImeKey As IME
   
   
End Sub
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("test")
   
   '******************************************
   ImeKey.Initialize("ImeKey")
   ImeKey.AddHeightChangedEvent
   ImeKey_HeightChanged(100%y,0)
   '*******************************************

End Sub
Sub ImeKey_HeightChanged(NewHeight As Int, OldHeight As Int)
   WebView1.Height = NewHeight
End Sub
 
Last edited:
Upvote 0
Top