add FileChooser
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user