2

I am trying to associate a custom file extension with my Xamarin-based Android application. I would like my application to open when the user chooses a particular type of file from the file manager.

My files use the extension ".label" but for some reason I cannot get Android to add my app to the chooser listen when selecting a file with such file extension.

However, if I use the ".xml" extension it seems to work. Here is the IntentFilter I am using:

[IntentFilter(new[] { Intent.ActionView, Intent.ActionEdit },
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataScheme = "file",
DataHost = "*",
DataMimeType = "*/*",
DataPathPattern = ".*\\.xml")]
gonzobrains
  • 7,856
  • 14
  • 81
  • 132

1 Answers1

4

This ended up working for me:

[IntentFilter(new[] { Intent.ActionView, Intent.ActionEdit },
    Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
    DataScheme = "file", 
    DataHost = "*",     
    DataPathPattern = ".*\\\\.label")]
gonzobrains
  • 7,856
  • 14
  • 81
  • 132