hi all i m using this code to make a screenshot and share this
this is working fine, make a screenshot if my screen and share on the fb, whatsapp etc
but it is very slow, when i press a button i need wait 7 - 10 seconds to see the screen to share.
why this?
the progressdialogshow dont work, i m using the ProgressDialogShow("lalala") on the begin but i dont see this, when i press a button i need wait the 7 - 10 seconds and i dont see the progressdialog
how can i make to fix the speed or show the progressdialog?
B4X:
Sub share_Click
ProgressDialogShow("lalala")
Try
Dim Obj1, Obj2 As Reflector
Dim bmp As Bitmap
Dim c As Canvas
Obj1.target = Obj1.GetActivityBA
Obj1.target = Obj1.GetField("vg")
bmp.InitializeMutable(Activity.Width, Activity.Height)
c.Initialize2(bmp)
Dim args(1) As Object
Dim types(1) As String
Obj2.target = c
Obj2.target = Obj2.GetField("canvas")
args(0) = Obj2.target
types(0) = "android.graphics.Canvas"
Obj1.RunMethod4("draw", args, types)
Dim out As OutputStream
out = File.OpenOutput(fp, "share.png", False)
bmp.WriteToStream(out, 100, "PNG")
out.Close
Dim sharer As MESShareLibrary
sharer.sharebinary( "file://" & fp & "/share.png","image/png", "Share With", "teste de compartilhamento" & userid)
ProgressDialogHide
Catch
ToastMessageShow("Error", False)
ProgressDialogHide
End Try
End Sub
this is working fine, make a screenshot if my screen and share on the fb, whatsapp etc
but it is very slow, when i press a button i need wait 7 - 10 seconds to see the screen to share.
why this?
the progressdialogshow dont work, i m using the ProgressDialogShow("lalala") on the begin but i dont see this, when i press a button i need wait the 7 - 10 seconds and i dont see the progressdialog
how can i make to fix the speed or show the progressdialog?