In my app, I try to load a file with the following code :
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.setType("application/octet-stream");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent, CODE_FOR_LOADING);
It works : the file picker is correctly displayed and I can choose the file I want to read and I successfully read it.
My problem is that when or just before the file picker is displayed, I can notice my onSaveInstanceState
function is called and it doesn't seem logical to me...
Anybody knows why it happens and if a mean to avoid this exists?