mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 03:16:27 -04:00
Potential aliviation of "Screen Overlay Detected" warning
This commit is contained in:
parent
07a7122e74
commit
aa5d4c82c1
@ -144,4 +144,5 @@
|
|||||||
<string name="path_not_writable">Can not access desired directory, using default. To fix this reselect the desired directory in app settings.</string>
|
<string name="path_not_writable">Can not access desired directory, using default. To fix this reselect the desired directory in app settings.</string>
|
||||||
<string name="pref_full_text_search_title">Fulltext Search</string>
|
<string name="pref_full_text_search_title">Fulltext Search</string>
|
||||||
<string name="pref_full_text_search_summary">Allow app to search the text within articles. Caution this can slow search down considerably.</string>
|
<string name="pref_full_text_search_summary">Allow app to search the text within articles. Caution this can slow search down considerably.</string>
|
||||||
|
<string name="reboot_message">Due to a bug in android 6.0 we require you to reboot your device to continue without granting us the storage permission. We are sorry for any inconvenience this may cause.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -935,9 +935,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean openZimFile(File file, boolean clearHistory) {
|
public boolean openZimFile(File file, boolean clearHistory) {
|
||||||
if (ContextCompat.checkSelfPermission(this,
|
if (file.canRead() || Build.VERSION.SDK_INT < 19 || (Constants.IS_CUSTOM_APP && Build.VERSION.SDK_INT != 23)) {
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE)
|
|
||||||
== PackageManager.PERMISSION_GRANTED || Build.VERSION.SDK_INT < 19 || (Constants.IS_CUSTOM_APP && Build.VERSION.SDK_INT != 23)) {
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
if (ZimContentProvider.setZimFile(file.getAbsolutePath()) != null) {
|
if (ZimContentProvider.setZimFile(file.getAbsolutePath()) != null) {
|
||||||
|
|
||||||
@ -1003,6 +1001,10 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
|||||||
newZimFile.setData(Uri.fromFile(mFile));
|
newZimFile.setData(Uri.fromFile(mFile));
|
||||||
startActivity(newZimFile);
|
startActivity(newZimFile);
|
||||||
} else {
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setMessage(getResources().getString(R.string.reboot_message));
|
||||||
|
AlertDialog dialog = builder.create();
|
||||||
|
dialog.show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user