On Jan 6, 2:55 pm, "Mark Murphy" <mmur...@commonsware.com> wrote:
> > Now, if I click a link in an email, I get the dialog where I can
> > choose whether to open the link with my app or with Browser. This is
> > all well and good, but I also get this dialog whenever I click a link
> > in the Browser app, or even enter a URL in the address field!
>
> That's what you specified in the intent filter -- you claim to support
> every HTTP(S) URL everywhere regardless of MIME type, host, or anything
> else.

That is correct, yes.

> That's why the intent filter is evil.

"Evil" is a bit harsh, isn't it? :) After all, it's pretty much the
same filter used by Browser (with the omission of about: URIs)

> > Is there a way to circumvent this
> > behavior in the Browser app, yet still present my app as an option
> > when clicking links in email clients and the like?
>
> Intent filters are agnostic to the sender of the Intent, so anything in
> the system could send an Intent that your intent filter will match. Then,
> if the sender uses Intent.createChooser(), like the Browser app does, you
> will appear as a viable option.

I guess this part is my actual problem. I can see why the email app
would invoke ResolverActivity, but why the Browser would do this for
every clicked link and every entered URL is unclear to me. As
mentioned, Steel doesn't do this. Setting Steel to the default URL
handler will therefore, in effect, render the Browser app unusable
since any click or address entry in Browser will be sent to Steel.

It seems like the answer to my question is "no" then?

> Furthermore, you really need to more tightly constrain that intent filter,
> so it is only going to be used for MIME types you actually will support,
> or only from certain sites, or something. Look at the <data> element in
> the SDK documentation:

Well, the MIME type of a HTTP(S) resource will be unknown until the
network resource is opened, won't it? For example when I click a link
in an email. Anyway, since text/html and application/xhtml+xml are
among the MIME types I'm interested in, I guess it wouldn't help me if
I did know the type beforehand; Browser would still pop up a chooser
that contained my app along with Browser itself.
-- 
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