I download file from S3 AWS server and I want to create bitmap but I get and error:
File file = new File(Environment.getExternalStorageDirectory().toString() + "/" + event.getImagePath());
// Log.e("CHECK",Environment.getExternalStorageDirectory().toString());
TransferUtility transferUtility = Util.getTransferUtility(EventAdapter.this.getContext());
// Initiate the download
TransferObserver observer = transferUtility.download(AWSConfiguration.BUCKET_NAME, event.getImagePath(), file);
Bitmap bitmap = BitmapFactory.decodeFile(observer.getAbsoluteFilePath());
//
imageView.setImageBitmap(bitmap);
ERROR:
E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/49039c3d-a257-4ee4-b967-f1d3be1d516f.png: open failed: ENOENT (No such file or directory)
Aucun commentaire:
Enregistrer un commentaire