我想让用户点击按钮访问我的网站。
但是,我希望该应用打开Google Chrome或其他外部网络浏览器以打开网站,而不是使用WebView加载网址。
我该怎么做?
答案 0 :(得分:0)
您可以使用ACTION_VIEW
Intent
-
Uri myUri = Uri.parse("http://www.whereever.com/");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(myUri);
startActivity(intent);
如果您想通过点击按钮进行操作,则需要将其放在onClick
的{{1}}方法中。