我知道如何使用意图打开网址:
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);
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?
上一篇:重复报警管理在API精确间隔=> 19?间隔、精确、API、GT
下一篇:Android的Recyclerview多个项目的onclick多个、项目、Android、Recyclerview