开发者

make default application in android?

If more than one application supports to open a specified file format. I need to ma开发者_Python百科ke my application as a default application from my code.How it possible to make it default from the code?? Can anyone help me?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜