Public Sub MyToastMessageShow(Text As Object, LongDuration As Boolean, Center As Boolean, BackgroundColor As Int, TextColor As Int, Alert As Boolean)
Dim toast As JavaObject
Dim ctxt As JavaObject
Dim duration As Int
ctxt.InitializeContext
If LongDuration Then
duration = 1
Else
duration = 0
End If
Dim cs As CSBuilder
cs.Initialize.Typeface(Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC)).Bold.Color(TextColor).Size(16).Append(Text).PopAll
toast = toast.InitializeStatic("android.widget.Toast").RunMethod("makeText", Array(ctxt, cs, duration))
Dim v As View = toast.RunMethod("getView", Null)
v.Background = MakeColorDrawable(BackgroundColor, 5dip, 2dip, TextColor)
If Center Then
toast.RunMethod("setGravity", Array(Bit.Or(Gravity.CENTER_HORIZONTAL, Gravity.CENTER_VERTICAL), 0, 0))
End If
If Alert Then
mAlertBeeper.Beep
End If
toast.RunMethod("show", Null)
End Sub