don't create OpenKeychain dir on startup

This commit is contained in:
Vincent Breitmoser
2017-11-29 14:52:49 +01:00
parent 86e41f8996
commit ecf9249247
9 changed files with 23 additions and 31 deletions

View File

@@ -100,26 +100,23 @@ public class FileHelper {
fragment.startActivityForResult(intent, requestCode);
}
public static void openDocument(Fragment fragment, Uri last, String mimeType, boolean multiple, int requestCode) {
public static void openDocument(Fragment fragment, String mimeType, boolean multiple, int requestCode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
&& hasOpenDocumentIntent(fragment.getContext())) {
openDocumentKitKat(fragment, mimeType, multiple, requestCode);
} else {
openDocumentPreKitKat(fragment, last, mimeType, multiple, requestCode);
openDocumentPreKitKat(fragment, mimeType, multiple, requestCode);
}
}
/** Opens the preferred installed file manager on Android and shows a toast
* if no manager is installed. */
private static void openDocumentPreKitKat(
Fragment fragment, Uri last, String mimeType, boolean multiple, int requestCode) {
private static void openDocumentPreKitKat(Fragment fragment, String mimeType, boolean multiple, int requestCode) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2) {
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
}
intent.setData(last);
intent.setType(mimeType);
try {