我想要在 android 中打开不和谐服务器的 Intent 。
我知道如何为 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")))
关于java - 我如何使用基于 Intent 的 URI 打开不和谐服务器邀请?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57204331/