From c488052501957095cd9f85150e2dab0049ec2622 Mon Sep 17 00:00:00 2001 From: joel Date: Sun, 13 Jun 2021 21:39:29 +0200 Subject: [PATCH] add FileChooser --- .../java/de/joel/zoomhelper/FileChooser.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 app/src/main/java/de/joel/zoomhelper/FileChooser.java diff --git a/app/src/main/java/de/joel/zoomhelper/FileChooser.java b/app/src/main/java/de/joel/zoomhelper/FileChooser.java new file mode 100644 index 0000000..a82ebde --- /dev/null +++ b/app/src/main/java/de/joel/zoomhelper/FileChooser.java @@ -0,0 +1,22 @@ +package de.joel.zoomhelper; + +import android.app.Activity; +import android.content.Intent; + +import java.io.File; + +public class FileChooser { + // Request code for selecting a PDF document. + private final Activity act; + + public FileChooser (Activity act) { + this.act = act; + } + + public void openFile() { + Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + intent.setType("application/octet-stream"); + act.startActivityForResult(intent, 2); + } +}