Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ireneRK's avatar
ireneRK
Honored Guest
3 years ago

Selecting a file in the file browser

I'm trying to get a file path with startActivityForResult and ACTION_OPEN_DOCUMENT.
The file browser opens. When I select a file, the file browser closes, but the universal menu is still open. In my code onActivityResult is never called.
Any idea why this is not working on the Quest 2? I already tried with enabling the WRITE_EXTERNAL_STORAGE permission. And I also tried ACTION_GET_CONTENT instead of ACTION_OPEN_DOCUMENT.
 

 

 

@Override
public void onCreate( Bundle savedInstanceState ) {
...
	Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
	intent.setType("*/*");
	startActivityForResult( intent, PICK_FILE_CODE );
}

@Override
public void onActivityResult( int requestCode, int resultCode, Intent data ) {
 // never gets called
}