diff options
-rw-r--r-- | android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index e8809973777f..fd1e2a217b14 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -166,15 +166,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); registerReceiver(mUSBReceiver, filter); // init UI and populate with contents from the provider - if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - Log.i(LOGTAG, "no permission to read external storage - asking for permission"); - ActivityCompat.requestPermissions(this, - new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, - PERMISSION_READ_EXTERNAL_STORAGE); - } else { - switchToDocumentProvider(documentProviderFactory.getDefaultProvider()); - setEditFABVisibility(View.VISIBLE); - } + createUI(); fabOpenAnimation = AnimationUtils.loadAnimation(this, R.anim.fab_open); @@ -946,6 +938,15 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings @Override protected void onStart() { super.onStart(); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + Log.i(LOGTAG, "no permission to read external storage - asking for permission"); + ActivityCompat.requestPermissions(this, + new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, + PERMISSION_READ_EXTERNAL_STORAGE); + } else { + switchToDocumentProvider(documentProviderFactory.getDefaultProvider()); + setEditFABVisibility(View.VISIBLE); + } Log.d(LOGTAG, "onStart"); } |