Dim jo As JavaObject = sf
Dim cd As ColorDrawable
cd.Initialize2(Colors.White, 4dip, 1dip, Colors.ARGB(45,0,0,0))
jo.RunMethodJO("getWindow", Null).RunMethod("setBackgroundDrawable", Array(cd))
Dim jo As JavaObject = sf
Dim window As JavaObject = jo.RunMethodJO("getWindow", Null)
Dim lp As JavaObject = window.RunMethod("getAttributes", Null)
lp.SetField("gravity", Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL))
lp.SetField("y", 0dip) 'set the top position
window.RunMethod("setAttributes", Array(lp))
Wait For (sf) Dialog_Result (Res As Int)