How to open default browser

后端 未结 2 606
耶瑟儿~
耶瑟儿~ 2021-01-16 13:51

I want to make somethink like hyperlink. Right now, i created button, which opens new Activity with WebView. But i want to open a \"globally\" default web browser at specifi

2条回答
  •  生来不讨喜
    2021-01-16 14:35

    Just make and Intent and set the link as uri to the intent. Then use the intent to start activity. Try this:

    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://stackoverflow.com")));
    

提交回复
热议问题