Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Why does MimeTypeMap.Singleton.GetMimeTypeFromExtension for db returns null?

lpinholpinho USMember ✭✭


I'm trying to change the filepicker (FilePicker-Plugin-for-Xamarin-and-Windows) intent to only show me db files, I thought that if I passed the correct mime-type it would only show me the db files.

I tried several mime-types associated with .db files (sqlite) and none worked, so I tried to get the mime type like this:

            string extension = MimeTypeMap.GetFileExtensionFromUrl(filedata.FilePath);
            string mimeType = MimeTypeMap.Singleton.GetMimeTypeFromExtension(extension);

And mimeType is set to null.

This is the code I want to change (FilePickerActivity.cs):

Am I doing something stupid?

Thanks for the help,

Luís Pinho


Sign In or Register to comment.