Intent.ACTION_VIEW 根据用户的数据类型打开相应的Activity。这里要打开一个网页,出现ActivityNotFoundException错误。
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=www.baidu.com }
Uri uri = Uri.parse("www.baidu.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
myContext.startActivity(intent);
原因为uri网址格式不正确,应添加 http:// 。