jjzjj

insertImage

全部标签

android - 删除由 MediaStore.Images.Media.insertImage 创建的图像和缩略图

我明白了MediaStore.Images.Media.insertImage(ContentResolvercr,Bitmapsource,Stringtitle,Stringdescription)将创建2个文件(图像和缩略图)如何删除两个已创建的图像? 最佳答案 使用此命令使用您要删除的图像的ID:mediaStoreIds.add(mediaStoreId);context.getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,Bas

android - MediaStore.Images.Media.insertImage - java.io.FileNotFoundException - Android

Note:similarquestionisaskedoverbelowSOlinks,butnoneoftheproposedsolutionworkedforme,hencestartingthisthread.MediaStore.Images.Media.insertImageisreturningnullwhentryingtosavetheimageWhyImages.Media.insertImagereturnnull问题陈述:我正在从url下载图像,然后尝试共享它。为此,我需要Uri,这是我通过将图像保存在MediaStore.Images.Media中获得的。代码:

android - insertImage 中的未知 URI 错误

尝试将位图保存到图库中Bitmapbitmap=Bitmap.createBitmap(surfaceView.getWidth(),surfaceView.getHeight(),Bitmap.Config.ARGB_8888);surfaceView.draw(newCanvas(bitmap));MediaStore.Images.Media.insertImage(getContentResolver(),bitmap,"foo","bar");我在模拟器上运行了应用程序并得到了一个UnsupportedOperationException。07-2522:27:48.719:

android - MediaStore.Images.Media.insertImage 在某些设备上抛出权限拒绝

我的代码行有问题:Stringpath=MediaStore.Images.Media.insertImage(activity.getContentResolver(),bitmap,"feedback",null);Activity不为空,位图不为空。我得到错误:0-2211:23:59.64429514-29527/?E/DatabaseUtils:Writingexceptiontoparcel10-2211:23:59.64429514-29527/?E/DatabaseUtils:java.lang.SecurityException:PermissionDenial:wr

android - 为什么 Images.Media.insertImage 返回 null

我有一些代码在其中运行MediaStore.Images.Media.insertImage方法(从源插入而不是文件名),此代码将图像保存到MediaStore并返回图像的uri。我知道当它因任何原因失败时,它将返回null而不是uri。该图像已被许多人多次下载,并且每隔一段时间它会从此方法返回null。我从来没有遇到过这种情况,所以我不知道发生了什么。发生这种情况的原因是什么?还有一个post有同样的问题,但答案是指向MediaStore源代码的链接,但该链接转到一个页面,说该链接不可用。任何帮助,将不胜感激。谢谢。取出我的SD卡后,我收到了这个错误,所以我知道这可能是一个原因,我不

android - 为什么 Images.Media.insertImage 返回 null

我有一些代码在其中运行MediaStore.Images.Media.insertImage方法(从源插入而不是文件名),此代码将图像保存到MediaStore并返回图像的uri。我知道当它因任何原因失败时,它将返回null而不是uri。该图像已被许多人多次下载,并且每隔一段时间它会从此方法返回null。我从来没有遇到过这种情况,所以我不知道发生了什么。发生这种情况的原因是什么?还有一个post有同样的问题,但答案是指向MediaStore源代码的链接,但该链接转到一个页面,说该链接不可用。任何帮助,将不胜感激。谢谢。取出我的SD卡后,我收到了这个错误,所以我知道这可能是一个原因,我不

android - MediaStore.Images.Media.insertImage 在尝试保存图像时返回 null

我正在使用自定义View,并且我正在使用用户可以在其中绘制任何内容的Canvas,之后我想将该图像保存在sd卡中bt无法做到这一点。不知道发生了什么事。elseif(view.getId()==R.id.save_btn){//savedrawingAlertDialog.BuildersaveDialog=newAlertDialog.Builder(this);saveDialog.setTitle("Savedrawing");saveDialog.setMessage("SavedrawingtodeviceGallery?");saveDialog.setPositiveBu

android - MediaStore.Images.Media.insertImage 在尝试保存图像时返回 null

我正在使用自定义View,并且我正在使用用户可以在其中绘制任何内容的Canvas,之后我想将该图像保存在sd卡中bt无法做到这一点。不知道发生了什么事。elseif(view.getId()==R.id.save_btn){//savedrawingAlertDialog.BuildersaveDialog=newAlertDialog.Builder(this);saveDialog.setTitle("Savedrawing");saveDialog.setMessage("SavedrawingtodeviceGallery?");saveDialog.setPositiveBu

android - 为什么 Images.Media.insertImage 不需要 WRITE_EXTERNAL_STORAGE 权限

我意识到我没有在我的`AndroidManifest.xmlStringpath=Images.Media.insertImage(((Activity)MainView.this.getContext()).getContentResolver(),screenCaptureBitmap,"Title","Description");仍然能够将图像文件写入位置/mnt/sdcard/DCIM/Camera。我可以知道为什么会这样吗? 最佳答案 可能取决于内容提供商MediaStore,你通过它来插入,它是一个RPC调用。和Medi