Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从我的应用程序拍摄的照片,保存在正确的文件夹中,但可以';我在画廊里看不见_Java_Android_Android Gallery_Image Capture - Fatal编程技术网

Java 从我的应用程序拍摄的照片,保存在正确的文件夹中,但可以';我在画廊里看不见

Java 从我的应用程序拍摄的照片,保存在正确的文件夹中,但可以';我在画廊里看不见,java,android,android-gallery,image-capture,Java,Android,Android Gallery,Image Capture,我的照片在拍摄时已保存,但在画廊中看不到!我用文件管理器在正确的文件夹中看到它,但不在库中 Intent intent = new Intent(); // Picture from camera intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); Date date = new Date(); DateFormat df = new SimpleDateF

我的照片在拍摄时已保存,但在画廊中看不到!我用文件管理器在正确的文件夹中看到它,但不在库中

Intent intent = new Intent();
           // Picture from camera
           intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);

           Date date = new Date();
           DateFormat df = new SimpleDateFormat("-mm-ss");

           String newPicFile = "Photo"+ df.format(date) + ".jpg";
           String outPath = Environment.getExternalStorageDirectory() + "/DCIM/" + newPicFile;
           File outFile = new File(outPath);

           mCameraFileName = outFile.toString();
           Uri outuri = Uri.fromFile(outFile);
           intent.putExtra(MediaStore.EXTRA_OUTPUT, outuri);


           startActivityForResult(intent, CAPTURE_IMAGE );

我什么都试过了,但没有一件是好的

检查库是否已刷新;它不经常刷新。您可以使用以下方法调用刷新请求:


((BaseAdapter)yourGalleryView.getAdapter()).notifyDataSetChanged()

有没有更简单的方法;这是一个相当简单的解决方案。你不喜欢它的什么地方?