Android浏览器:打开几个网址,每一个新的窗口/标签(编程) [英] Android Browser: open several URLs, each on new window/tab (programmatically)
问题描述
我知道如何使用意图打开网址:
I know how to open a URL using Intents:
Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.lala.com"));
startActivity(browserIntent);
但我怎么能打开多个网址,每个新窗口/标签???
But how can I open multiple URLs, each on new window/tab???
尝试创建若干意图和不同的startActivity每次打开,但它只是打开列表中的最后一个;
Tried creating several Intents and opened each with different startActivity but it just opens the last one on the list;
code code code
startActivity(Intent1); startActivity(Intent2); startActivity(Intent3); -> only Intent3 is opened eventually (which of course make sense :)).
鸭preciate任何帮助!
Appreciate any help!
更新:仍然在寻找一个答案:/
UPDATE: still looking for an answer :/
我想出一个可行的解决方案,这的确会打开一个新窗口的URL。
I've come up with a possible solution, which indeed opens the URL in a new window.
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);
<一个href="http://www.netmite.com/android/mydroid/2.0/packages/apps/Browser/src/com/android/browser/BrowserBookmarksPage.java"相对=nofollow> BrowserBookmarksPage.java
莫名其妙任何方式启动活动可一次打开几个网址吗?东西的setResult()及startActivityForResult()可能?
Any way of somehow start the Activity to open several URLs at once? something with setResult() & startActivityForResult() maybe?
推荐答案
我想出一个可行的解决方案,这的确会打开网址在新窗口中。
I've come up with a possible solution, which indeed opens the URL in a new window.
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);
反正不知怎么开始的活动可以一次打开几个网址吗?东西的setResult()及startActivityForResult()可能?
Anyway of somehow start the Activity to open several URLs at once? something with setResult() & startActivityForResult() maybe?
这篇关于Android浏览器:打开几个网址,每一个新的窗口/标签(编程)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!