On Mon, Nov 7, 2011 at 9:55 AM, Neilz <neilhorn...@gmail.com> wrote:
> Thanks Mark. Now that I know what to be searching for, I've found
> several similar topics mostly on stackoverflow.
>
> Most topics have a response by Hackbod, stating not to do it that way,
> but I'm struggling a little to understand what it is he's suggesting
> instead.

FYI, hackbod is Dianne Hackborn.

> I don't get this bit:
>
> "The best way to use this, if you want to ensure it launches only your
> app, is with your own scoped action and using Intent.setPackage() to
> say the Intent will only match your app package."

"your own scoped action" would be, say,
com.commonsware.android.MY_OWN_CUSTOM_ACTION, instead of ACTION_VIEW.

> and also...
>
> "Finally, you may want to set the package of the intent to your app
> with this: 
> http://developer.android.com/reference/android/content/Intent.html#setPackage(java.lang.String)

Um, that seems straightforward enough. Call setPackage() with the
package name of whatever app should contain the recipient of the
Intent -- no other app's components will be considered.

> Where exactly is he suggesting that I use this? My link is going to
> come from an external browser over which I have little control.

No, but you are in charge of the URL that you are redirecting to.
Those passages pertain to the use of an intent: URL, generated via a
call to toUri() on a properly-constructed Intent. You would redirect
to that URL.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to