0

HOW SHOULD I GET IT SOLVED

File root = new File(Environment.getExternalStorageDirectory() + File.separator + getResources().getString(R.string.app_name) + File.separator);
        root.mkdirs();
        File sdImageMainDirectory = new File(root, fileName);
        output = new FileOutputStream(sdImageMainDirectory);
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, output);
        output.flush();
        result = true;
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (null != output) {
            try {
                output.close();
            } catch (IOException e) {
                e.printStackTrace();

            }
        }
    }
    return result;
}strong text
Nirav Ranpara
  • 13,753
  • 3
  • 39
  • 54

0 Answers0