android实现按钮跳转到指定网页

 时间:2024-10-12 06:30:49

1、构造一个按鸵晚簧柢钮,Button rdcy=(Button)findViewById(R.id.rdcy); rdcy.setOnClickListener(new View.OnClick讣嘬铮篌Listener() { @Override public void onClick(View v) { Uri uri = Uri.parse("http://baike.baidu.com/view/753813.htm"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } });

2、按钮的代码添加在protected void onCreate(Bundle savedInstanceState){}方法里。

3、Uri uri = Uri.parse("http://baike.baidu.com/view/753813.htm"); Intent intent = new Intent(Intent.ACTION_VIEW, uri);"http://baike.baidu.com/view/753813.htm"为你要转到的网站。

  • php+mysql怎样一次插入多条记录到数据库
  • IDEA代理抛出异常:1099端口占用
  • 如何用PHP往MySQL中插入数据
  • Power Designer做出完整逻辑图
  • IntelliJ IDEA怎么设置打开软件自动打开项目
  • 热门搜索
    落枕怎么办简单快速的有效方法 车贴怎么贴 肚脐疼是怎么回事 男人小便有泡沫是怎么回事 白木耳的做法大全 白醋洗脸的正确方法 通分的方法 检查装置气密性的方法 家常炖鱼 婴儿早教方法