If more than one application supports to open a specified file format. I need to make my application as a default application from my code.How it possible to make it default from the code?? Can anyone help me?
Asked
Active
Viewed 1,316 times
2 Answers
3
On a regular phone the user always get's a choice between the alternatives, while on newer OS (not sure if it started with 2.1 or earlier) versions, he can check 'use as default' but this can only be done by the user himself. Cannot do it code-wise.

Mathias Conradt
- 28,420
- 21
- 138
- 192
-
Thanks for your response.Is there any possibility to check our application is a default or not ? – Alex Jul 26 '10 at 12:08
1
It depends on what are you planning to do. If the action sends an intent you can register for the intent with highest possible priority (999) and you'll be the first that will receive it, after you handle it you can abort it by calling abortBroadcast(). Much of the music players do this when they handle headset buttons.

Mojo Risin
- 8,136
- 5
- 45
- 58
-
I have to check my application is a default or not. If it's not a default when the user try to open my application at that time i have to get some data from the user.Can you give some ideas for this?? – Alex Jul 27 '10 at 04:35
-
I don't think there is such think as default application on android. What exactly do you mean by default application on android you can't just double click on some *.mp3 file to open it with some app. Please explain in more derails what are trying to do and with what data your application is going to work so we can help you. – Mojo Risin Jul 27 '10 at 05:46
-
I download ics file from my application.When the user try to open the file the Android device will list the possible application to perform. When the user select my application to open the ics file at that time i will get some details from the user(about the user). If they select my application as a default i won't ask the detail about the user.For that i need to check my application is a default application or not.If it default i will directly open the file otherwise i wish to get the details about user. – Alex Jul 27 '10 at 08:27
-
Take a look to this post http://stackoverflow.com/questions/2934981/how-to-download-ics-file-from-the-browser-in-android (and links included in it) i don't think you can make your application "default" you can register your application as one that can handle such files (using intent filter) and than android will add link to your app in the list with possible choices. – Mojo Risin Jul 27 '10 at 08:55