Android Intent打开URL链接

Linux大全评论1.2K views阅读模式

一、打开链接

Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.linuxidc.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);

企鹅博客
  • 本文由 发表于 2019年9月20日 23:31:08
  • 转载请务必保留本文链接:https://www.qieseo.com/152564.html

发表评论