title: Save ImageView to sdcard android
body: <p>I want to save an <code>ImageView</code> that I show with <code>setImageURI</code> in <code>SDcard</code> inside my android device...</p>
  
  <p><strong>How can I achieve that?</strong></p>
  
  <p><strong>Code:</strong> </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  ImageView imageView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      imageView = (ImageView) findViewById(R.id.imageView);
  
      imageView.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent intent = new Intent();
              intent.setType("image/*");
              intent.setAction(Intent.ACTION_GET_CONTENT);
              startActivityForResult(Intent.createChooser(intent, "Select Image"), 1);
          }
      });
  }
  
  @Override
  protected void onActivityResult(int reqCode, int resCode, Intent data) {
      if(resCode == RESULT_OK){
          if(reqCode == 1)
              imageView.setImageURI(data.getData());
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>