图片设置联系人头像和壁纸

//设置联系人头像和壁纸

Intent intent =new Intent(Intent.ACTION_ATTACH_DATA);

String path = Environment.getExternalStorageDirectory().getPath() +"/3.png";

File image =new File(path);

Uri uri = Uri.fromFile(image);

intent.setDataAndType(uri,"image/*");

intent.putExtra("mimeType","image/*");

intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

startActivity(Intent.createChooser(intent,"设置为"));

你可能感兴趣的:(图片设置联系人头像和壁纸)