mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
parent
9b41cda69d
commit
04b6d07b2b
@ -1931,21 +1931,12 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
|
||||
private void searchFiles() {
|
||||
if (Build.VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
if (ContextCompat.checkSelfPermission(this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
Toast.makeText(this, R.string.request_storage,
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[] { Manifest.permission.READ_EXTERNAL_STORAGE },
|
||||
REQUEST_READ_STORAGE_PERMISSION);
|
||||
} else {
|
||||
fileSearch.scan(sharedPreferenceUtil.getPrefStorage());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= VERSION_CODES.M && ContextCompat.checkSelfPermission(this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[] { Manifest.permission.READ_EXTERNAL_STORAGE },
|
||||
REQUEST_READ_STORAGE_PERMISSION);
|
||||
} else {
|
||||
fileSearch.scan(sharedPreferenceUtil.getPrefStorage());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user