Dim jo As JavaObject
jo.InitializeContext
Dim decor As JavaObject = jo.RunMethodJO("getWindow", Null).RunMethod("getDecorView", Null)
Dim decorChild As JavaObject = decor.RunMethod("getChildAt", Array(0))
decorChild.RunMethod("setDrawingCacheEnabled", Array(True))
decorChild.RunMethod("buildDrawingCache", Null)
Dim bmp As Bitmap = decorChild.RunMethod("getDrawingCache", Array(True))
bmp.Initialize3(bmp)
decorChild.RunMethod("setDrawingCacheEnabled", Array(False))
'Return bmp
Private RTP As RuntimePermissions
Log(RTP.GetSafeDirDefaultExternal(""))
Dim Out As OutputStream
Out = File.OpenOutput(RTP.GetSafeDirDefaultExternal(""), "Test.png", False)
bmp.WriteToStream(Out, 100, "PNG")
Out.Close