1

I am building a video player and I want to make my app to be shown when someone want to play a video, like this :enter image description here

I searched for that for long time,but no results,any body can help me?

a7d.24_
  • 170
  • 1
  • 12
  • Add an `` for your player activity for `ACTION_VIEW`, the `content` scheme, and whatever video MIME types you support. There are many open source video player apps, and you can examine what they have in their manifests. – CommonsWare Aug 28 '21 at 15:05

1 Answers1

3

First of all add intent filter to manifest

 <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <data android:mimeType="video/*"/>
        <data android:scheme="content"/>
        <data android:scheme="file"/>
    </intent-filter>

Then to get video URI in you Activity:

Uri uri = getIntent().getData();

For more information check this

user16728174
  • 182
  • 1
  • 4