Sub Globals
Private ime1 As IME
Private WebView1 As WebView
Private ActivityParent As JavaObject
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("WebView1")
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
ime1.Initialize("ime1")
ime1.AddHeightChangedEvent
WebView1.LoadUrl("http://www.google.com")
Dim jo As JavaObject = Activity
jo.RunMethodJO("getContext", Null).RunMethodJO("getWindow", Null).RunMethod("setSoftInputMode", _
Array As Object(0x20))
ActivityParent = jo.RunMethodJO("getParent", Null)
End Sub
Sub IME1_HeightChanged (NewHeight As Int, OldHeight As Int)
CallSubDelayed(Me, "AfterChange")
End Sub
Sub AfterChange
Dim ajo As Panel = Activity
Dim width As Int = ActivityParent.RunMethod("getMeasuredWidth", Null)
Dim height As Int = ActivityParent.RunMethod("getMeasuredHeight", Null)
If width = 0 OR height = 0 Then Return
ajo.Width = width 'update the "activity" width and height
ajo.Height = height
WebView1.Width = width
WebView1.Height = height
End Sub
Sub Activity_Resume
AfterChange
End Sub