【问题标题】:how can i open discord server invite with intent based URI?如何使用基于意图的 URI 打开不和谐服务器邀请?
【发布时间】:2019-12-03 20:54:56
【问题描述】:

我想要一个在 android 中打开 discord 服务器的意图。

我知道如何为 twitter 做这件事,尝试过这样但不起作用

try {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=username")));
} catch (Exception e) {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/username")));
}

【问题讨论】:

  • 请发布日志它显示的问题错误是什么
  • 当我这样做时- startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("discord://invite/uWrSv3")));什么都没有发生

标签: java android android-intent discord


【解决方案1】:

我通过测试不同的东西找到了我们,如果你安装了不和谐,你不需要明确指定任何东西,我这样做如下

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://discord.gg/invitecode")))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-08-28
    • 1970-01-01
    • 2021-08-11
    • 2022-01-21
    • 2020-10-01
    • 2021-09-13
    • 2021-04-22
    • 2020-12-02
    相关资源
    最近更新 更多