imageButtonBrowser
.setOnClickListener(new ImageButton.OnClickListener() {
public void onClick(View v) {
Uri uri = Uri.parse("http://www.baidu.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});【Android基础】Android跳转浏览器打开URL
最新推荐文章于 2023-03-31 14:51:32 发布
本文介绍了一个简单的示例,展示如何在Android应用程序中通过Intent启动浏览器并打开指定网址。此方法适用于需要引导用户浏览外部网页的应用场景。
352

被折叠的 条评论
为什么被折叠?



