Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

IntentFilter on Android is not working for my file type

$
0
0

Hi,
I would like to share file from eg. Downloads folder in FileManager, to my application. My application uses files with my custom file extension: ".topo". I would like to open that but can't. My application is not listed in the list of applicaitons.

I added this code on top of MainActivity class decleration:

    [IntentFilter(new[] { Intent.ActionView, Intent.ActionEdit, Intent.ActionSend },
    Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
    DataScheme = "file",
    DataHost = "*",
    DataPathPattern = ".*\\\\.topo")]

When I use:
[IntentFilter(new[] { Intent.ActionSend }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = @"application/pdf")]

It works perfectly.

What am I missing here? Filename is just numbers and letters.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>