【问题标题】:how to use the intent anchor to launch my app with extra data(parameters) in android如何在 android 中使用意图锚点启动我的带有额外数据(参数)的应用程序
【发布时间】:2015-10-22 05:41:35
【问题描述】:

我曾经尝试过在 javascript 中使用 URI 模式来启动我的应用,如下所示:

window.location = "myapp://api/image?imageurl=hogehoge" 

但它在android中失败了。我不知道为什么。 iphone里没问题...

所以我改为使用意图锚点在 android 中启动我的应用程序,如此处所述。我可以让它使用这种语法启动我的应用程序,

<a href="intent://#Intent;scheme=http;package=com.example.myapp;end">Launch my app</>

但是如果我使用意图锚点,我怎样才能传递额外的数据("api/image?imageurl=hogehoge")

也许我可以将"S.imageurl=hogehoge" 添加到href 但我怎样才能通过这个→"api/image?"

【问题讨论】:

  • 查看stackoverflow.com/a/23253200/769265了解如何添加额外内容的详细说明。
  • 你可以试试这样的:&lt;a href="intent://api/image?imageurl=hogehoge#Intent;scheme=http;package=com.example.myapp;end"&gt;Launch my app&lt;/a&gt;
  • @DavidWasser 谢谢!它有效!如果我想添加更多参数,我可以这样使用吗? 启动我的应用
  • 是的,应该可以。我创建了一个答案,这样问题就不会出现在“未回答”列表中。

标签: android android-intent


【解决方案1】:

试试这样的:

<a href="intent://api/image?imageurl=hogehoge#Intent;scheme=http;package=com.exampl‌​e.myapp;end">Launch my app</a> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多