Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
- String imageFileName = "PNG_" + timeStamp + "_" + ".png";
- File imageFile = File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), imageFileName);
- OutputStream stream = new FileOutputStream(imageFile);
- bbm.compress(Bitmap.CompressFormat.PNG,100,stream);
- stream.flush();
- stream.close();
- }catch (IOException e) // Catch the exception
- e.printStackTrace();
- }
- Uri savedImageURI = Uri.parse(file.getAbsolutePath());
- back.setImageURI(savedImageURI);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement