在写头像打开手机相册时报No Activity found to handle intent错误,我的代码如下
intent = new Intent(Intent.ACTION_PICK, null);
intent.setDataAndType(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
"image*/*");
intent.setType("image/*");//开始没有添加这句报错
startActivityForResult(intent,
REQUESTCODE_UPLOADAVATAR_LOCATION);
检查是否开启权限<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
具体原因参考http://stackoverflow.com/questions/21045091/no-activity-found-to-handle-intent-android-intent-action-open-document