add FileChooser

This commit is contained in:
2021-06-13 21:39:29 +02:00
parent 06e3d7972f
commit c488052501
@@ -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);
}
}