C cncncn Member Licensed User Longtime User Apr 23, 2013 #1 Hi! I would like to open a PDF on Adobe Reader but everytime Adobe opens, there is this message: 'Can not open open file' I checked directory file, filename and I can open the file directly by Adobe. I don't see a mistake in my code Code: Dim PdfIntent As Intent PdfIntent.Initialize(PdfIntent.ACTION_VIEW,File.Combine(DestDT,DT)) PdfIntent.SetComponent("android/com.android.internal.app.ResolverActivity") PdfIntent.SetType("application/pdf") StartActivity(PdfIntent) I really need some :sign0085: Thanks in advance
Hi! I would like to open a PDF on Adobe Reader but everytime Adobe opens, there is this message: 'Can not open open file' I checked directory file, filename and I can open the file directly by Adobe. I don't see a mistake in my code Code: Dim PdfIntent As Intent PdfIntent.Initialize(PdfIntent.ACTION_VIEW,File.Combine(DestDT,DT)) PdfIntent.SetComponent("android/com.android.internal.app.ResolverActivity") PdfIntent.SetType("application/pdf") StartActivity(PdfIntent) I really need some :sign0085: Thanks in advance
GMan Well-Known Member Licensed User Longtime User May 14, 2013 #4 i would like to know that, too :sign0163: Upvote 0
C cncncn Member Licensed User Longtime User May 15, 2013 #5 My mistake was in my uri when I intialize the intent. I wrote "/storage/sdcard0/.../file.pdf" and the right way was "file:///storage/sdcard0/.../file.pdf" I hope it can help you Upvote 0
My mistake was in my uri when I intialize the intent. I wrote "/storage/sdcard0/.../file.pdf" and the right way was "file:///storage/sdcard0/.../file.pdf" I hope it can help you
GMan Well-Known Member Licensed User Longtime User May 15, 2013 #6 thx, found already this solution: Code: Sub OpenPDF(filename As String) Dim i As Intent 'Requires a reference to the Phone library i.Initialize(i.ACTION_VIEW, filename) i.SetType("application/pdf") 'i.WrapAsIntentChooser("Choose PDF Viewer") StartActivity(i) End Sub Code: Dim folder As String folder=File.DirRootExternal & "/nem" Dim filename As String If Position = 0 Then filename = "nem001" & Country & ".pdf" OpenPDF("file://" & File.Combine(folder, filename)) Without Code: i.WrapAsIntentChooser("Choose PDF Viewer") the choosing-popup doesnt appear each time Upvote 0
thx, found already this solution: Code: Sub OpenPDF(filename As String) Dim i As Intent 'Requires a reference to the Phone library i.Initialize(i.ACTION_VIEW, filename) i.SetType("application/pdf") 'i.WrapAsIntentChooser("Choose PDF Viewer") StartActivity(i) End Sub Code: Dim folder As String folder=File.DirRootExternal & "/nem" Dim filename As String If Position = 0 Then filename = "nem001" & Country & ".pdf" OpenPDF("file://" & File.Combine(folder, filename)) Without Code: i.WrapAsIntentChooser("Choose PDF Viewer") the choosing-popup doesnt appear each time