簡體   English   中英

從我的應用程序拍攝的照片,保存在正確的文件夾中,但在圖庫中看不到

[英]Photo taken from my app, saved in the right folder but can't see in the gallery

拍攝時我的照片已保存,但在圖庫中看不到! 我在正確的文件夾中看到了文件管理器,但在圖庫中卻沒有看到它。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM