iOS Question ActivityViewController Error

MList

Active Member
Licensed User
Hi All, i need help. I just wand to save a .png file on iphone
and get an Error.
Thanks for your help



avc error:
Var.Filepath = xui.DefaultFolder
'********************************************************************************************************************
' Speichern
'********************************************************************************************************************
Public Sub Speichern
    Dim Out As OutputStream
    Out = File.OpenOutput(Var.Filepath, Var.ProjektName  & ".png", False)
    Var.ProjektPic.WriteToStream(Out, 100, "PNG")  [I][SIZE=3] [I]' var.projektPic  = B4XBitmap[/I][/SIZE][/I]
    Out.Close
 End Sub

[CODE=b4x] 
   Dim avc As ActivityViewController

         If File.Exists(Var.Filepath, Var.ProjektName  & ".png") Then
           [COLOR=rgb(235, 107, 86)] avc.Initialize("avc", Array(LoadBitmap(Var.Filepath,Var.ProjektName & ".png")))[/COLOR]
            avc.Show(B4XPages.GetNativeParent(Me), Root) 'Second parameter is relevant for iPad only. The arrow will point to the view.
            Wait For avc_Complete (Success As Boolean, ActivityType As String)
            Log($"Success: ${Success}, ActivityType: ${ActivityType}"$)
        End If
[/CODE]


Error occurred on line: 735 (B4XPWerte)
Target is null. Method called: Initialize:::
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
TopCheck +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 160
TopCheck -[B4IShell runVoidMethod] + 208
TopCheck -[B4IShell raiseEventImpl:method:args::] + 1624
TopCheck -[B4IShellBI raiseEvent:event:params:] + 1580
TopCheck +[B4IDebug delegate:::] + 76
TopCheck -[b4i_b4xpwerte _exportcsv:] + 172
TopCheck -[b4i_b4xpwerte _txtexportpic_click:] + 636
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
TopCheck +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1300
TopCheck -[B4IShell runMethod:] + 416
TopCheck -[B4IShell raiseEventImpl:method:args::] + 1984
TopCheck -[B4IShellBI raiseEvent:event:params:] + 1580
TopCheck __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1068
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1924
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 104
UIKitCore UIApplicationMain + 212
TopCheck main + 104
libdyld.dylib <redacted> + 4
)

 

MList

Active Member
Licensed User
The other way... The command Dim avc was in an if statement which wasnt't passed ? ? ?

Thanks a lot for the idea ?
 
Upvote 1
Solution
Top