Android : Saving the generated QR code image to a SD card
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/649154/android-bitmap-save-to-location">Android : Bitmap save to location</a>  </p>
</blockquote>



<p>I have successfully created a QR code generator application but cannot save the generated image to a external storage. I have tried various practices but failed to do so. Following is the class where the image generated is showed on the screen and then i have to use a button called save button to store the image but i cannot get it done. Can someone please help me to sort out this. Will be very thankful for your efforts in helping me. cheers</p>

<pre><code>     public class QRDisplay extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.qr_view);

    String url = getIntent().getStringExtra("IMAGE_URL");

    ImageView imageView = (ImageView)findViewById(R.id.qr_image);
    try {
        URL imageURL = new URL(url);
        Bitmap qrBitmap = BitmapFactory.decodeStream(imageURL.openStream());
        imageView.setImageBitmap(qrBitmap);
    } catch (Exception e) {
        Log.d("QRDisplay", e.getMessage());
    }


Button saveButton= (Button)findViewById(R.id.saveButton);
saveButton.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
    ?????????????????   
    }
});

}
</code></pre>

<p>}</p>
