Hi everyone, I am not able to make the following code to open a specific file.
B4X:
BytesToFile(File.DirDefaultExternal & "/" & AppName,vFileName,mm.Image)
chatroompage.chat1.AddItem(mm.Name & CRLF & vFileName,False)
Log("-----------Done-------------")
'ToastMessageShow("Download complete!",False)
Msgbox2Async("Do you wantto open this file?", "Download complete", "Yes", "Cancel", "", Null, False)
Wait For Msgbox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
Log("Yes")
Dim i As Intent
i.Initialize(i.ACTION_VIEW,File.DirDefaultExternal & "/" & AppName &"/"& vFileName)
i.SetType("application/pdf")
StartActivity(i)
End If