Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ActivityParent As JavaObject
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim jo As JavaObject = Activity
jo.RunMethodJO("getContext", Null).RunMethodJO("getWindow", Null).RunMethod("setSoftInputMode", _
Array As Object(0x20))
ActivityParent = jo.RunMethodJO("getParent", Null)
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
Dim lbl As Label
lbl.Initialize("")
Activity.AddView(lbl, 0, 0, Activity.Width, Activity.Height)
lbl.Gravity = Gravity.CENTER_HORIZONTAL + Gravity.CENTER_VERTICAL
Dim TA As MSTooleapActivityHelper
If TA.isStartedByTooleap Then
lbl.Text = "Started by Tooleap"
Else
lbl.Text = "Started in normal mode"
End If
End Sub