Android Question How to open a PDF with Intent inside a panel?

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I have a question.


I need to select a PDF on the user's phone (user will select this file), then open it and show the content to the user. If the user selected the correct file, I want him to confirm it by clicking a button below to save the file name in the local database.

I'm using FileProvider and Content resolver to show a list of folders and files - this is done already. My problem is how to open a PDF with the Intent. The problem is that the Intent starts on top of the Activity. But I need to open it inside activity so I can put a button below.

My question is- is it possible to open Intent inside a panel? In iOS I can use Webview to open a PDF but in Android Webview does not support it.

Thank you.
 

MarcoRome

Expert
Licensed User
Longtime User
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
when I try to open this project it shows this message
 

Attachments

  • screen.png
    screen.png
    3.7 KB · Views: 114
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
>when I try to open this project it shows this message

not here

B4A Version: 12.20
Parse den Code. (0.00s)
Java Version: 8
Building folders structure. (0.02s)
Kompiliere den Code. (0.02s)
Kompiliere Layoutcode. (0.03s)
Organisiere Libraries. (4.01s)
(AndroidX SDK)
Ressourcen zusammenstellen (2.60s)
Ressourcen verknüpfen (3.84s)
Kompiliere generierten Java Code. (2.74s)
Suchen von Bibliotheken, die dexiert werden müssen. (0.05s)
Dex: E:\AndroidSDK.2022_11\tools\..\extras\b4a_local\unpacked-pdfium.androidx-63700777472736\jars\b4a_jni (0.63s)
Dex: E:\AndroidSDK.2022_11\tools\..\extras\b4a_local\unpacked-pdfium.androidx-63700777472736\jars\classes (1.19s)
Dex: E:\AndroidSDK.2022_11\tools\..\extras\b4a_local\unpacked-android-pdf-viewer.androidx-63697663160197\jars\classes (1.46s)
Dex: PDFium (1.03s)
Dex code (2.61s)
Dex merge (4.57s)
Kopieren von Bibliothek Ressourcen (11.05s)
ZipAlign file. (0.20s)
Signiere Paketdatei (privater Key). (1.29s)
Installiere Datei auf Gerät. Error
Kein Gerät gefunden.

It is not installed because there is no device connected. But the example can be compiled FINE here.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
when I try to open this project it shows this message
i don´t know where b4apdfviewer is coming from. It is not part of PDFium library!?

Do you use

free-lib-b4apdfviewer-by-icefairy333???? this library is not related to PDFium

Looks like you are confusing different libraries and want to try an example from another library?

The example in PDFium-Thread linked above by @MarcoRome is working here.
 
Last edited:
Upvote 0
Top