0

I am building TV app that lets user pick a video from storage and returns its full path. Intent.ACTION_GET_CONTENT not working on Android TV. But works on phone. TV not supporting Storage Access Framework.
MY CODE is not working on Android TV. Let me know how to achieve this.

fileintent= new Intent(Intent.ACTION_GET_CONTENT);
fileintent.setType("video/*");
startActivityForResult(fileintent, 10 );
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {

    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode) {
        case 10:

            if (resultCode == RESULT_OK) {
                videopath = data.getDataString();
                Toast.makeText(MainActivity.this, videopath, Toast.LENGTH_LONG).show();

                videov.setVideoURI(Uri.parse(videopath));
                videov.seekTo(1);
                //  videov.start();
            }

            break;

    }
}
Boyan Hristov
  • 1,067
  • 3
  • 15
  • 41
Nathan
  • 1
  • 1
  • You should check what information is printed in logcat console – Eric Feb 18 '20 at 20:24
  • --------- beginning of crash 2020-02-19 12:53:16.495 2576-2576/com.tv.hellotv E/AndroidRuntime: FATAL EXCEPTION: main Process: com.tv.hellotv, PID: 2576 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT typ=video/* } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809) – Nathan Feb 19 '20 at 07:31
  • Have you tried approach written out below in this issue? https://stackoverflow.com/questions/31380013/how-to-pick-image-or-video-on-android-l – Eric Feb 19 '20 at 08:57

0 Answers0