My app won't show up on the chooser dialog for android.intent.action.VIEW with mime type video/* only on Marshmallow
O

2

7

Basically when an app shares a video url my app is supposed to show up on the list but it doesn't. Neither does MXPlayer but the Google Photos media player shows up fine as well as allcast (which had a recent release to fix this).

I wrote a quick app to test this issue, here are my manifest filters:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

<intent-filter>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="text/plain"/>
    <data android:mimeType="video/*"/>
    <data android:mimeType="audio/*"/>
    <data android:mimeType="image/*"/>
    <action android:name="android.intent.action.SEND"/>
</intent-filter>

<intent-filter>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:mimeType="video/*" android:scheme="http"/>
    <data android:mimeType="audio/*" android:scheme="http"/>
    <data android:mimeType="image/*" android:scheme="http"/>
    <data android:mimeType="video/*" android:scheme="https"/>
    <data android:mimeType="audio/*" android:scheme="https"/>
    <data android:mimeType="image/*" android:scheme="https"/>
    <data android:mimeType="video/*" android:scheme="file"/>
    <data android:mimeType="audio/*" android:scheme="file"/>
    <data android:mimeType="image/*" android:scheme="file"/>
    <action android:name="android.intent.action.VIEW"/>
</intent-filter>

<intent-filter>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:host="*" android:pathPattern=".*\\.mp4" android:scheme="http"/>
    <action android:name="android.intent.action.VIEW"/>
</intent-filter>

And this is the code to reproduce the issue:

Intent intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(Uri.parse("http://media.w3.org/2010/05/sintel/trailer.mp4"),"video/*");
startActivity(intent);

This is only an issue on Marshmallow.

EDIT: I should add that not all Marshmallow devices do this. It took me a long time to reproduce it from the first time I heard about it and one day it just started happening on my Nexus 5. My 6P won't reproduce this.

EDIT: I added some debugging code prior to startActivity. Basically I'm asking the package manager to give me the intent activities that can handle that intent and I get back the exact same list I see on the dialog.

PackageManager manager = getBaseContext().getPackageManager();
                List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
                if (infos.size() > 0) {
                    //THE INFOS LIST HAS THE 3 APPS THAT IT SHOWS BUT MINE IS MISSING
                }else{

                }

EDIT: I figured adding screenshots might make it more clear.

This is on my Nexus 5 with 6.0.1, the list is fully expanded This is on my Nexus 5 with 6.0.1, the list is fully expanded

This is on my Nexus 4 with 5.1.1, list also fully expanded This is on my Nexus 4 with 5.1.1, list also fully expanded

Both phones have pretty much the exact same apps.

Obscure answered 16/1, 2016 at 23:34 Comment(6)
have you tried one intent-filter per mime-type?Cumming
I tested your intent-filters on a Nexus 9 running Android 6.0.1 and it worked fine. What are you using to duplicate the issue?Supersensible
@Cumming I have tried every combination I could think of.Obscure
@JaredRummler there might be some Android 6.0.1 devices where this works. It has taken me like a month to reproduce the issue since my users started reporting it and all of the sudden I started being able to reproduce it on my Nexus 5. My Nexus 6P still can't reproduce it.Obscure
You could try intent-intercept to get some more detailsCumming
@Cumming I have two on my phone and neither show up on the list.Obscure
O
9

Fixed it! All I had to do was remove <category android:name="android.intent.category.BROWSABLE"/>

Obscure answered 21/1, 2016 at 16:43 Comment(0)
G
3

Try the following for your intent-filters

<activity >
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="rtmp"/>
        <data android:scheme="rtmpe"/>
        <data android:scheme="rtmps"/>
        <data android:scheme="rtp"/>
        <data android:scheme="rtsp"/>
        <data android:scheme="mms"/>
        <data android:scheme="mmsh"/>
        <data android:scheme="icyx"/>
        <data android:scheme="httplive"/>
        <data android:scheme="udp"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:mimeType="video/*"/>
        <data android:mimeType="audio/*"/>
        <data android:mimeType="image/*"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme=""/>
        <data android:scheme="file"/>
        <data android:scheme="ftp"/>
        <data android:scheme="content"/>
        <data android:scheme="http"/>
        <data android:scheme="https"/>
        <data android:mimeType="video/*"/>
        <data android:mimeType="audio/*"/>
        <data android:mimeType="*/rmvb"/>
        <data android:mimeType="*/avi"/>
        <data android:mimeType="*/mkv"/>
        <data android:mimeType="application/3gpp*"/>
        <data android:mimeType="application/mp4"/>
        <data android:mimeType="application/mpeg*"/>
        <data android:mimeType="application/ogg"/>
        <data android:mimeType="application/sdp"/>
        <data android:mimeType="application/vnd.3gp*"/>
        <data android:mimeType="application/vnd.apple.mpegurl"/>
        <data android:mimeType="application/vnd.dvd*"/>
        <data android:mimeType="application/vnd.dolby*"/>
        <data android:mimeType="application/vnd.rn-realmedia*"/>
        <data android:mimeType="application/x-iso9660-image"/>
        <data android:mimeType="application/x-extension-mp4"/>
        <data android:mimeType="application/x-flac"/>
        <data android:mimeType="application/x-matroska"/>
        <data android:mimeType="application/x-mpegURL"/>
        <data android:mimeType="application/x-ogg"/>
        <data android:mimeType="application/x-quicktimeplayer"/>
        <data android:mimeType="application/x-shockwave-flash"/>
        <data android:mimeType="application/xspf+xml"/>
        <data android:mimeType="misc/ultravox"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme=""/>
        <data android:scheme="file"/>
        <data android:scheme="ftp"/>
        <data android:scheme="content"/>
        <data android:scheme="http"/>
        <data android:scheme="https"/>
        <data android:host="*"/>
        <data android:pathPattern=".*\\.3g2"/>
        <data android:pathPattern=".*\\.3gp"/>
        <data android:pathPattern=".*\\.3gp2"/>
        <data android:pathPattern=".*\\.3gpp"/>
        <data android:pathPattern=".*\\.amv"/>
        <data android:pathPattern=".*\\.asf"/>
        <data android:pathPattern=".*\\.avi"/>
        <data android:pathPattern=".*\\.divx"/>
        <data android:pathPattern=".*\\.drc"/>
        <data android:pathPattern=".*\\.dv"/>
        <data android:pathPattern=".*\\.f4v"/>
        <data android:pathPattern=".*\\.flv"/>
        <data android:pathPattern=".*\\.gvi"/>
        <data android:pathPattern=".*\\.gxf"/>
        <data android:pathPattern=".*\\.ismv"/>
        <data android:pathPattern=".*\\.iso"/>
        <data android:pathPattern=".*\\.m1v"/>
        <data android:pathPattern=".*\\.m2v"/>
        <data android:pathPattern=".*\\.m2t"/>
        <data android:pathPattern=".*\\.m2ts"/>
        <data android:pathPattern=".*\\.m3u8"/>
        <data android:pathPattern=".*\\.mkv"/>
        <data android:pathPattern=".*\\.mov"/>
        <data android:pathPattern=".*\\.mp2"/>
        <data android:pathPattern=".*\\.mp2v"/>
        <data android:pathPattern=".*\\.mp4"/>
        <data android:pathPattern=".*\\.mp4v"/>
        <data android:pathPattern=".*\\.m4v"/>
        <data android:pathPattern=".*\\.mpe"/>
        <data android:pathPattern=".*\\.mpeg"/>
        <data android:pathPattern=".*\\.mpeg1"/>
        <data android:pathPattern=".*\\.mpeg2"/>
        <data android:pathPattern=".*\\.mpeg4"/>
        <data android:pathPattern=".*\\.mpg"/>
        <data android:pathPattern=".*\\.mpv2"/>
        <data android:pathPattern=".*\\.mts"/>
        <data android:pathPattern=".*\\.mtv"/>
        <data android:pathPattern=".*\\.mxf"/>
        <data android:pathPattern=".*\\.mxg"/>
        <data android:pathPattern=".*\\.nsv"/>
        <data android:pathPattern=".*\\.nut"/>
        <data android:pathPattern=".*\\.nuv"/>
        <data android:pathPattern=".*\\.ogm"/>
        <data android:pathPattern=".*\\.ogv"/>
        <data android:pathPattern=".*\\.ogx"/>
        <data android:pathPattern=".*\\.ps"/>
        <data android:pathPattern=".*\\.rec"/>
        <data android:pathPattern=".*\\.rm"/>
        <data android:pathPattern=".*\\.rmvb"/>
        <data android:pathPattern=".*\\.tod"/>
        <data android:pathPattern=".*\\.ts"/>
        <data android:pathPattern=".*\\.tts"/>
        <data android:pathPattern=".*\\.vob"/>
        <data android:pathPattern=".*\\.vro"/>
        <data android:pathPattern=".*\\.webm"/>
        <data android:pathPattern=".*\\.wm"/>
        <data android:pathPattern=".*\\.wmv"/>
        <data android:pathPattern=".*\\.wtv"/>
        <data android:pathPattern=".*\\.xesc"/>
        <data android:pathPattern=".*\\.3G2"/>
        <data android:pathPattern=".*\\.3GP"/>
        <data android:pathPattern=".*\\.3GP2"/>
        <data android:pathPattern=".*\\.3GPP"/>
        <data android:pathPattern=".*\\.AMV"/>
        <data android:pathPattern=".*\\.ASF"/>
        <data android:pathPattern=".*\\.AVI"/>
        <data android:pathPattern=".*\\.DIVX"/>
        <data android:pathPattern=".*\\.DRC"/>
        <data android:pathPattern=".*\\.DV"/>
        <data android:pathPattern=".*\\.F4V"/>
        <data android:pathPattern=".*\\.FLV"/>
        <data android:pathPattern=".*\\.GVI"/>
        <data android:pathPattern=".*\\.GXF"/>
        <data android:pathPattern=".*\\.ISMV"/>
        <data android:pathPattern=".*\\.ISO"/>
        <data android:pathPattern=".*\\.M1V"/>
        <data android:pathPattern=".*\\.M2V"/>
        <data android:pathPattern=".*\\.M2T"/>
        <data android:pathPattern=".*\\.M2TS"/>
        <data android:pathPattern=".*\\.M3U8"/>
        <data android:pathPattern=".*\\.MKV"/>
        <data android:pathPattern=".*\\.MOV"/>
        <data android:pathPattern=".*\\.MP2"/>
        <data android:pathPattern=".*\\.MP2V"/>
        <data android:pathPattern=".*\\.MP4"/>
        <data android:pathPattern=".*\\.MP4V"/>
        <data android:pathPattern=".*\\.M4V"/>
        <data android:pathPattern=".*\\.MPE"/>
        <data android:pathPattern=".*\\.MPEG"/>
        <data android:pathPattern=".*\\.MPEG1"/>
        <data android:pathPattern=".*\\.MPEG2"/>
        <data android:pathPattern=".*\\.MPEG4"/>
        <data android:pathPattern=".*\\.MPG"/>
        <data android:pathPattern=".*\\.MPV2"/>
        <data android:pathPattern=".*\\.MTS"/>
        <data android:pathPattern=".*\\.MTV"/>
        <data android:pathPattern=".*\\.MXF"/>
        <data android:pathPattern=".*\\.MXG"/>
        <data android:pathPattern=".*\\.NSV"/>
        <data android:pathPattern=".*\\.NUT"/>
        <data android:pathPattern=".*\\.NUV"/>
        <data android:pathPattern=".*\\.OGM"/>
        <data android:pathPattern=".*\\.OGV"/>
        <data android:pathPattern=".*\\.OGX"/>
        <data android:pathPattern=".*\\.PS"/>
        <data android:pathPattern=".*\\.REC"/>
        <data android:pathPattern=".*\\.RM"/>
        <data android:pathPattern=".*\\.RMVB"/>
        <data android:pathPattern=".*\\.TOD"/>
        <data android:pathPattern=".*\\.TS"/>
        <data android:pathPattern=".*\\.TTS"/>
        <data android:pathPattern=".*\\.VOB"/>
        <data android:pathPattern=".*\\.VRO"/>
        <data android:pathPattern=".*\\.WEBM"/>
        <data android:pathPattern=".*\\.WM"/>
        <data android:pathPattern=".*\\.WMV"/>
        <data android:pathPattern=".*\\.WTV"/>
        <data android:pathPattern=".*\\.XESC"/>
        <data android:pathPattern=".*\\.3ga"/>
        <data android:pathPattern=".*\\.a52"/>
        <data android:pathPattern=".*\\.aac"/>
        <data android:pathPattern=".*\\.ac3"/>
        <data android:pathPattern=".*\\.adt"/>
        <data android:pathPattern=".*\\.adts"/>
        <data android:pathPattern=".*\\.aif"/>
        <data android:pathPattern=".*\\.aifc"/>
        <data android:pathPattern=".*\\.aiff"/>
        <data android:pathPattern=".*\\.amr"/>
        <data android:pathPattern=".*\\.aob"/>
        <data android:pathPattern=".*\\.ape"/>
        <data android:pathPattern=".*\\.awb"/>
        <data android:pathPattern=".*\\.caf"/>
        <data android:pathPattern=".*\\.dts"/>
        <data android:pathPattern=".*\\.flac"/>
        <data android:pathPattern=".*\\.it"/>
        <data android:pathPattern=".*\\.m4a"/>
        <data android:pathPattern=".*\\.m4b"/>
        <data android:pathPattern=".*\\.m4p"/>
        <data android:pathPattern=".*\\.mid"/>
        <data android:pathPattern=".*\\.mka"/>
        <data android:pathPattern=".*\\.mlp"/>
        <data android:pathPattern=".*\\.mod"/>
        <data android:pathPattern=".*\\.mpa"/>
        <data android:pathPattern=".*\\.mp1"/>
        <data android:pathPattern=".*\\.mp2"/>
        <data android:pathPattern=".*\\.mp3"/>
        <data android:pathPattern=".*\\.mpc"/>
        <data android:pathPattern=".*\\.mpga"/>
        <data android:pathPattern=".*\\.oga"/>
        <data android:pathPattern=".*\\.ogg"/>
        <data android:pathPattern=".*\\.oma"/>
        <data android:pathPattern=".*\\.opus"/>
        <data android:pathPattern=".*\\.ra"/>
        <data android:pathPattern=".*\\.ram"/>
        <data android:pathPattern=".*\\.rmi"/>
        <data android:pathPattern=".*\\.s3m"/>
        <data android:pathPattern=".*\\.spx"/>
        <data android:pathPattern=".*\\.tta"/>
        <data android:pathPattern=".*\\.voc"/>
        <data android:pathPattern=".*\\.vqf"/>
        <data android:pathPattern=".*\\.w64"/>
        <data android:pathPattern=".*\\.wav"/>
        <data android:pathPattern=".*\\.wma"/>
        <data android:pathPattern=".*\\.wv"/>
        <data android:pathPattern=".*\\.xa"/>
        <data android:pathPattern=".*\\.xm"/>
        <data android:pathPattern=".*\\.3GA"/>
        <data android:pathPattern=".*\\.A52"/>
        <data android:pathPattern=".*\\.AAC"/>
        <data android:pathPattern=".*\\.AC3"/>
        <data android:pathPattern=".*\\.ADT"/>
        <data android:pathPattern=".*\\.ADTS"/>
        <data android:pathPattern=".*\\.AIF"/>
        <data android:pathPattern=".*\\.AIFC"/>
        <data android:pathPattern=".*\\.AIFF"/>
        <data android:pathPattern=".*\\.AMR"/>
        <data android:pathPattern=".*\\.AOB"/>
        <data android:pathPattern=".*\\.APE"/>
        <data android:pathPattern=".*\\.AWB"/>
        <data android:pathPattern=".*\\.CAF"/>
        <data android:pathPattern=".*\\.DTS"/>
        <data android:pathPattern=".*\\.FLAC"/>
        <data android:pathPattern=".*\\.IT"/>
        <data android:pathPattern=".*\\.M4A"/>
        <data android:pathPattern=".*\\.M4B"/>
        <data android:pathPattern=".*\\.M4P"/>
        <data android:pathPattern=".*\\.MID"/>
        <data android:pathPattern=".*\\.MKA"/>
        <data android:pathPattern=".*\\.MLP"/>
        <data android:pathPattern=".*\\.MOD"/>
        <data android:pathPattern=".*\\.MPA"/>
        <data android:pathPattern=".*\\.MP1"/>
        <data android:pathPattern=".*\\.MP2"/>
        <data android:pathPattern=".*\\.MP3"/>
        <data android:pathPattern=".*\\.MPC"/>
        <data android:pathPattern=".*\\.MPGA"/>
        <data android:pathPattern=".*\\.OGA"/>
        <data android:pathPattern=".*\\.OGG"/>
        <data android:pathPattern=".*\\.OMA"/>
        <data android:pathPattern=".*\\.OPUS"/>
        <data android:pathPattern=".*\\.RA"/>
        <data android:pathPattern=".*\\.RAM"/>
        <data android:pathPattern=".*\\.RMI"/>
        <data android:pathPattern=".*\\.S3M"/>
        <data android:pathPattern=".*\\.SPX"/>
        <data android:pathPattern=".*\\.TTA"/>
        <data android:pathPattern=".*\\.VOC"/>
        <data android:pathPattern=".*\\.VQF"/>
        <data android:pathPattern=".*\\.W64"/>
        <data android:pathPattern=".*\\.WAV"/>
        <data android:pathPattern=".*\\.WMA"/>
        <data android:pathPattern=".*\\.WV"/>
        <data android:pathPattern=".*\\.XA"/>
        <data android:pathPattern=".*\\.XM"/>
        <data android:pathPattern=".*\\.asx"/>
        <data android:pathPattern=".*\\.ASX"/>
        <data android:pathPattern=".*\\.m3u"/>
        <data android:pathPattern=".*\\.M3U"/>
        <data android:pathPattern=".*\\.pls"/>
        <data android:pathPattern=".*\\.PLS"/>
        <data android:pathPattern=".*\\.xspf"/>
        <data android:pathPattern=".*\\.XSPF"/>
    </intent-filter>
</activity>

Also try using "video/mp4" instead of "video/*" in your "code to reproduce the issue"

Intent intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(Uri.parse("http://media.w3.org/2010/05/sintel/trailer.mp4"),
                      "video/mp4");
startActivity(intent);

HTHs

Granulite answered 19/1, 2016 at 17:42 Comment(9)
Thanks for that very comprehensive list but it has the same issue.Obscure
@mntgoat You may want to check again, I'm able to get my this to work (my app shows up in the chooser) when I view a webpage with that link in it.Granulite
Can you check if MXPlayer shows up for you? if it does then you are not seeing the issue on your phone. Only some phones seem to experience it.Obscure
DERP!! totally forgot I'm trying this on my 6P running jan update (so latest 6.0.1)Granulite
@mntgoat MX Player also shows up (same 6P 6.0.1 device)Granulite
At this point I don't even know which phones do it. I've had sporadic user reports, I've also seen people on reddit complain about this, and until recently I couldn't reproduce it but now I can on my Nexus 5 with 6.0.1.Obscure
@mntgoat just checked on Nexus 5 running 6.0.1 (MMB29S). The above code works there too.Granulite
I have the same exact build, that is bizarre but I know I'm not crazy. Both allcast and localcast released updates recently fixing this and they both show up on the list just fine.Obscure
Let us continue this discussion in chat.Granulite

© 2022 - 2024 — McMap. All rights reserved.