The docs say you can use an "http:" uri, which is not quite a
"specific real URL" in the way I guess you intend.

http://developer.android.com/guide/appendix/g-app-intents.html

Is your advice in conflict with that page in the docs says about
browser intents?

It seems like my resolveActivity call conforms to the docs.  It works
until I add a second activity that also services "http" data.  So I
thought I was on the right track but misunderstanding what happens
when there are multiple apps that satisfy the resolution.

On Nov 21, 9:31 am, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sun, Nov 21, 2010 at 12:23 PM, jotobjects <jotobje...@gmail.com> wrote:
> > So I came up with what I thought was a great solution which worked
> > initially -
>
> > Intent resolveIntent = new Intent(Intent.ACTION_VIEW,
> > Uri.fromParts("http", "", null));
> > PackageManager pm = context.getPackageManager();
> > ResolveInfo ri = pm.resolveActivity(resolveIntent,
> > PackageManager.MATCH_DEFAULT_ONLY);
> > String packageName = ri.activityInfo.packageName;
> > String activityName = ri.activityInfo.name;
> > Intent webIntent = new Intent();
> > webIntent.setComponent(new ComponentName(packageName, activityName));
> > context.startActivity(webIntent);
>
> > This worked!  Yea.
>
> The odds of this working for every browser are slim to none. There is
> no requirement in Android for browser implementations to support this
> in any meaningful fashion. Please just open a specific real URL.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

-- 
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