---
title: "Android浏览器如何打开网页"
author: "marine8888"
date: "2011-01-29T19:12:51Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2011-01-29T19:12:51Z"
id: 899452
url: "https://androidstudy.iteye.com/blog/899452"
---

一、打开链接 

 

        Intent it = new Intent(Intent.ACTION\_VIEW, Uri.parse("http://www.baidu.com"));

        it.setClassName("com.android.browser", "com.android.browser.BrowserActivity");

        getContext().startActivity(it);

 

二、打开本地网页

 

Intent intent=new Intent();   
intent.setAction("android.intent.action.VIEW");   
Uri CONTENT\_URI\_BROWSERS = Uri.parse("content://com.android.htmlfileprovider/sdcard/123.html");   
intent.setData(CONTENT\_URI\_BROWSERS);   
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");   
startActivity(intent);