Skip to content Skip to sidebar Skip to footer

How To Open App From File Manager And Play Video Directly?

I am trying to make a video player app. I can play video by opening my app manually. But I want to show my app as an option like below picture: in short, when I click any video f

Solution 1:

add intent filter to activity. very similar to this.

<intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><dataandroid:mimeType="video/*" /></intent-filter>

also see this Forcing an app chooser

Solution 2:

Read how to achieve this in official documentation

Solution 3:

You need to put an intent filter in your manifest.xml. This tells the OS which types of media/ files your app is capable of handling. When you click a video file in file manager, Android issues an implicitintent . This basically puts out a wanted ad (excuse the analogy) to other apps that the file needs to be handled. When this happens, if your app has the capability to handle this file/ media type, it will respond. From here, if there is only one capable app, it will be selected for the task. If there are multiple capable apps, all of them will be added to a list, which is then displayed to the user (the list in the image you posted above.)

Solution 4:

Add the below code to inside activity(that you want to open) inside manifest:

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

use below code to your activity to get the uri of your file. I have tested the path in exoplayer.

Uriuri= getIntent().getData();

Post a Comment for "How To Open App From File Manager And Play Video Directly?"