我的应用程序拍照并在gridview中显示,但是我的问题是当我去通知的目录中查看它时,它出现在目录中,但是图像不返回,
这是我的代码:
private File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmm").format(new Date());
String imageFileName = "relatorio" + timeStamp + "_";
String path = Environment.getExternalStorageDirectory().toString() + "/VIEW REPORT/IMAGENS";
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory())));
File dir = new File(path);
if(!dir.exists())
dir.mkdirs();
File file = new File(dir, imageFileName);
if( mCurrentPhotoPath != null ) {
// write the document content
try {
OutputStream out = new FileOutputStream(file);
Toast.makeText(this, "PICTURE SAVE", Toast.LENGTH_LONG).show();
}
catch (IOException e) {
e.printStackTrace();
Toast.makeText(this, "TRY AGAIN: ", Toast.LENGTH_LONG).show();
}
}
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
dir /* directory */
);
这是我的设备文件浏览器,有人可以帮我吗?
请注意,其大小为0B