开发者

Android Custom URI Handler - Gmail App doesn't recognize?

I'm trying to open a link from my Gmail Application. If I send myapp://custom/params, Gmail only recognizes it as text. I can get the link to open my app开发者_JS百科lication "myapp" from a browser, though. How can I get around this?


I'd suggest that you use URIs with the content: scheme and a custom ContentProvider. See http://developer.android.com/guide/topics/providers/content-providers.html.


I think this comes down to a problem with the way the GMail apps looks for stuff to link up as URLs in the body of a text formatted message. I believe you have two options:

  1. Send the email message as HTML instead of plain text and explicitly href= link to your custom scheme.
  2. Instead of hooking to a custom scheme, setup your app to handle protocol http with the host and path set to something unique. As long as you include the exact path the intent filter shouldn't get in the way of normal browsing to your website.

I haven't tried either of those. #2 I'm pretty definite will work, however #1 might be a bit cleaner depending on your app.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜