androidandroid-intentandroid-browser

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???

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 :)).

Appreciate any help!

UPDATE: still looking for an answer :/

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

Any way of somehow start the Activity to open several URLs at once? something with setResult() & startActivityForResult() maybe?


Solution

  • 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);