[![Folder whith files (beginning)][1]][1]
In the second image...
I guess it is a problem of permits,... or something like that. But I do not know how to open a file not created by my app.
I have permits managed in AndroidManifest.xml and with:
if (ActivityCompat.checkSelfPermission(this
, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE
, Manifest.permission.READ_EXTERNAL_STORAGE},
k_id_requestpermissions_external_storage);
}
Can yo help me? Thanks a lot...
Finally I found the problem and the solution...
UNFORTUNATELY Google Play Console will present a lot of rejections to allow your app to have that permission... (problem->solution->new problem...)
I needed an extra permit:
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
intent_activityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult()
, new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
ResourceBundle in;
try {
in = ResourceBundles.getBundle(k_in_ruta);
if (result.getResultCode() != RESULT_CANCELED) {
put_alert("No permit! ");
}
} catch (Exception e) {
try {
put_alert(e);
} catch (Exception e_ignorar) {}
}
}
});
if (android.os.Build.VERSION.SDK_INT >= 30) {
if (Environment.isExternalStorageManager() == false) {
Intent intent = new Intent();
intent.setAction (Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
Uri uri = Uri.fromParts("package", this.getPackageName(), null);
intent.setData(uri);
intent_activityResultLauncher.launch(intent);
}
}