有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

从我的应用程序中拍摄的java照片,保存在正确的文件夹中,但在图库中看不到

我的照片在拍照时被保存了下来,但我在图库中看不到它!我在正确的文件夹中看到文件管理器,但在图库中看不到

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 );

我什么都试过了,但都没用


共 (1) 个答案

  1. # 1 楼答案

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

    ((BaseAdapter)你的GalleryView。getAdapter())。notifyDataSetChanged()