0

I could just get my files on removable storage by action_open_document tree and it gives me a document file. I can not open this file with Action_view. The URI from document file did work! I can open image file with action view .

String uri=DocumentFile.getUri.toString;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri);
intent.setDataAndType(Uri.parse(uri), "video/mp4");
activity.startActivity(intent);
H.P.
  • 1,181
  • 1
  • 13
  • 26
Mostafa
  • 95
  • 1
  • 10

1 Answers1

1

Other apps do not have access to that content. Add FLAG_GRANT_READ_URI_PERMISSION to the Intent to pass along your own read access to the third-party app.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491