我可以从资源中解析 uri 吗?

发布于 2024-08-25 18:42:44 字数 250 浏览 3 评论 0原文

// startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.donate_url))));
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")));

当我使用第一个时,应用程序将在模拟器中崩溃,但第二个运行良好,我该如何修复第一个?

// startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.donate_url))));
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")));

When I use the first,app will crash in emulator but the second run well, how can I fix the first?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔戏命师 2024-09-01 18:42:44

两条线路都工作正常..
在 2.1 模拟器中测试...
使用 donate_url= "http://www.google.com"

您所在的网址一定有问题使用...

检查日志猫,如 Pentium10 所说。

both the lines are working fine..
tested in 2.1 emulator...
with the donate_url= "http://www.google.com"

there must be problem with the url you are using...

check log cat as Pentium10 said.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文