我想使用intent共享位图图像,所以我在目录中创建此图像的文件,但我想删除由“Images.Media.insertImage(getContentResolver(),b,”title“,null)创建的此文件;” 分享后,我不能,这是代码
Picture picture = objetview.capturePicture();
Bitmap b = Bitmap.createBitmap( picture.getWidth(),
picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas( b );
picture.draw( c );
//b.compress(Bitmap.CompressFormat.JPEG, 90, null);
String pathofBmp = Images.Media.insertImage(getContentResolver(), b,"title", null);
Uri bmpUri = Uri.parse(pathofBmp);
final Intent emailIntent1 = new Intent( android.content.Intent.ACTION_SEND);
emailIntent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent1.putExtra(Intent.EXTRA_STREAM, bmpUri);
emailIntent1.setType("image/png");
startActivity(Intent.createChooser(emailIntent1, "Share Image"));
答案 0 :(得分:0)
试试这个:
getContentResolver().delete(bmpUri, null, null);
希望它有效!