我知道如何使用 Intents 打开 URL:
Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.lala.com"));
startActivity(browserIntent);
但是如何打开多个 URL,每个 URL 都在新窗口/标签上???
尝试创建几个 Intent 并使用不同的 startActivity 打开每个 Intent,但它只打开列表中的最后一个;
code code code
startActivity(Intent1); startActivity(Intent2); startActivity(Intent3); -> only Intent3 is opened eventually (which of course make sense :)).
感谢任何帮助!
更新:仍在寻找答案:/
我想出了一个可能的解决方案,它确实在新窗口中打开了 URL。
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.go.com"));
Bundle b = new Bundle();
b.putBoolean("new_window", true); //sets new window
intent.putExtras(b);
startActivity(intent);
任何方式以某种方式启动 Activity 以一次打开多个 URL?setResult() 和 startActivityForResult() 的东西可能吗?