title: Kotlin: How do I save the contents of an ImageView to the internal/external memory?
body: <p>So... I got this easy project where when clicking a button uses an intent to open the camera, take a picture, and if the user presses "OK" will display the photo image inside an ImageView, this is a fragment...</p>
  
  <p>On a button I call the camera intent and got the result URI in the <code>image_uri</code> variable, so I put this image in the ImageView object with:</p>
  
  <pre><code>imageView.setImageURI(image_uri)
  </code></pre>
  
  <p>Now, I want to save this image into the internal/external memory, or gallery. I saw many answers, and many tutorials on line to make this that says you have to use <code>buildDrawingCache()</code> method, problem is, Android Studio says this method is deprecated in Java.</p>
  
  <p>So what do I have to do?</p>
  
  <p>PS: I'm pretty new to Kotlin/Android development, so I don't know which parameters do I have to give you. I'm using <strong>Android Studio 3.4.1</strong>, <strong>JRE: 1.8.0_152-release-1343-b01</strong> using <strong>Windows 10</strong></p>