title: Save image to internal storage
body: <p>I want to save some images in internal storage. Here is my code:</p>
  
  <pre><code>Bitmap bitmap = ((BitmapDrawable)iv_add.getDrawable()).getBitmap();
              File file = getApplicationContext().getDir("Images",MODE_PRIVATE);
              file = new File(file, "UniqueFileName"+".jpg");
              try{
                  OutputStream stream = null;
                  stream = new FileOutputStream(file);
                  bitmap.compress(Bitmap.CompressFormat.JPEG,100,stream);
                  stream.flush();
                  stream.close();
              }catch (IOException e)
              {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>As I understood, the picture needs to go into internal_storage/android/data/project_name/file. When I choose a picture from my gallery and click the button to save it, nothing happens and the program starts lagging. What can I do?</p>