Sub Initialize(obj As Object, message As String, durationin As Int)
duration = durationin
If obj Is Activity Then
context = "activity"
pnl.Initialize("pnl")
lbl.Initialize("lbl")
lbl.Text = message
lbl.Height = height
pnl.Visible = False
pnl.Height = height
pnl.Width = lbl.Width
pnl.AddView(lbl, 0, 0, lbl.Width, height)
Dim act As Activity
act = obj
act.AddView(pnl, left, top, lbl.Width, height)
Else If obj Is String Then
Dim s As String
s = obj
If s="service" Then
context = "service"
Dim C As Object
duration = durationin
C = R.GetContext
T = R.RunStaticMethod("android.widget.Toast", "makeText", Array As Object(C, message, duration), Array As String("android.content.Context", "java.lang.CharSequence", "java.lang.int"))
End If
End If
End Sub