0

I want an activity to launch when a user touches a special URL embedded in an SMS message. I have an activity with an intent filter that matches my unique scheme, host, and pathPrefix. Of course the first time the user touches a link to my trigger url they are presented with the "Complete action using" selection that includes my application and any web browser the user has installed.

Is there a way I can programmatically set the "use by default" setting so my activity is the default action?

(I know this smells like I'd be taking away control from the user so I doubt it is possible, but I figured it wouldn't hurt to ask).

Michael Levy
  • 12,767
  • 15
  • 60
  • 98
  • I suppose you can use something from this question: http://stackoverflow.com/questions/2780102/open-another-application-from-your-own-intent – Michell Bak Aug 24 '11 at 16:10
  • I think I already handled the stuff discussed in that question. I can launch my activity from the Url fine, i just want to skip the step where the user has to select between my activity and the browser. – Michael Levy Aug 24 '11 at 16:21

2 Answers2

3

Is there a way I can programmatically set the "use by default" setting so my activity is the default action?

No, sorry.

I know this smells like I'd be taking away control from the user so I doubt it is possible

You have an exquisite olfactory sense... :-)

CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
0

it is possible as long as your app is signed with platform key, if so, just use ChooserActivity class from com.android.internal.app

Maciej Boguta
  • 1,194
  • 1
  • 9
  • 15