您的位置:首页 > 移动开发 > Android开发

ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.a

2015-06-27 17:57 841 查看
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://
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android 错误