I used an example from xchart from Klaus to make a snapshot of a graph.
I used this code
and i get an error
java.lang.Exception: Sub activity_permissionresult was not found.
So I put this
and error was the same
java.lang.Exception: Sub activity_permissionresult was not found.
Please help me.
Attached are test project.
Here are the log:
** Activity (main) Pause, UserClosed = false **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.Exception: Sub activity_permissionresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6131)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
** Activity (main) Resume **
I used this code
B4X:
Sub savesnapshot
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
'access here
Dim bmp As B4XBitmap = SingleLine1.Snapshot
Dim out As OutputStream
Dim mydir As String
mydir = File.DirRootExternal & "/DPF Graph Snapshots/"
' out = File.OpenOutput(File.DirRootExternal, "snap.png", False)
out = File.OpenOutput(mydir, "snap.png", False)
bmp.WriteToStream(out, 100, "PNG")
out.Close
Else
'no permission
End If
End Sub
java.lang.Exception: Sub activity_permissionresult was not found.
So I put this
B4X:
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
End Sub
java.lang.Exception: Sub activity_permissionresult was not found.
Please help me.
Attached are test project.
Here are the log:
** Activity (main) Pause, UserClosed = false **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.Exception: Sub activity_permissionresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6131)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
** Activity (main) Resume **
Attachments
Last edited: