Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make your app a default app to open a certain file

Tags:

android

How do I make my android app the default application to open a certain file type?

I tried to clear the defaults but the option is greyed out, does anyone know how to do this?

I want to make my app open with my something.whatever files in android.

like image 421
Felipe Suman Avatar asked Mar 26 '12 12:03

Felipe Suman


1 Answers

You cannot force this, and you shouldn't be able to. What you can do is make known your app can open the filetype. The user gets the standard "what program do you wish to use" dialog, and the user can select something as default. If the user has allready selected a default, he/she needs to undo that before the dialog appears (obviously, otherwise a 'default' wouldn't have a lot of effect, now would it?)

You can tell the world (aka: android) that you want to open a certain file type by adding an intent-filter. What you basically do is put in your manifest that an activity in your app knows how to handle the filetype (or website/protocol etc). That's quite easy to find, a random question here on SO about the same issue would be: Android intent filter for a particular file extension?

like image 124
Nanne Avatar answered Oct 13 '22 07:10

Nanne