开发者

Load default android web browser

开发者 https://www.devze.com 2023-02-09 11:05 出处:网络
I am currently developing an android application. I want the user to select an item from a listview from and it loads the url that is assigned with the selected option in the default android browser i

I am currently developing an android application. I want the user to select an item from a listview from and it loads the url that is assigned with the selected option in the default android browser instead of using a webview as that would mean that I would have to effectively ma开发者_如何学编程ke my own web browser.

Thanks for any help you can provide


You could do something like this:

Intent internet = new Intent(); 
internet.setAction(Intent.ACTION_VIEW); 
internet.addCategory(Intent.CATEGORY_BROWSABLE); 
internet.setData(Uri.parse("http://www.google.com")); 
startActivity(internet); 
0

精彩评论

暂无评论...
验证码 换一张
取 消