Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void saveImageToDownloadFolder(String imageFile, Bitmap ibitmap){
- try {
- File filePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), imageFile);
- OutputStream outputStream = new FileOutputStream(filePath);
- ibitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
- outputStream.flush();
- outputStream.close();
- Toast.makeText(MainActivity.this, imageFile + "Sucessfully saved in Download Folder", Toast.LENGTH_SHORT).show();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement