首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android浏览器怎么打开网页

2012-08-27 
Android浏览器如何打开网页一、打开链接 ? ? ? ? Intent it new Intent(Intent.ACTION_VIEW, Uri.parse(

Android浏览器如何打开网页

一、打开链接

    ? ? ? ? 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);

热点排行