简体   繁体   English

如何使用基于意图的URI打开Discord服务器邀请?

[英]how can i open discord server invite with intent based URI?

I want an intent to open discord server in android. 我想要在Android中打开Discord服务器。

I know how to do it for twitter, tried like this but does not work 我知道如何在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("https://discord.gg/invitecode")))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM