?

Log in

Launch Android Browser Intent - Toronto Dude

> Recent Entries
> Archive
> Friends
> Profile

Links
Toronto Apartments for Rent

July 2nd, 2011


Previous Entry Share Next Entry
06:53 pm - Launch Android Browser Intent
So I was looking how to launch an Android browser without a the generic VIEW intent, I needed to route a launch intent from my app, but my app was handling the VIEW intent for that same URL, so basically sending it back to VIEW means an annoying loop to the user. I need to open the browser directly.


Here is how I solved it:


intent = new Intent(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse(urlString));
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");



Hope this helps someone looking for this.
Tags:

 


> Go to Top
LiveJournal.com