title: Android: Saving a Bitmap Graph to the Image Gallery Using OnClick Listener
body: <p>I am a high school student looking for help saving a bitmap image creating using a modified version of the "Sensor Graph" tutorial available here: <a href="http://code.google.com/p/amarino/downloads/detail?name=SensorGraph_02.zip&amp;can=2&amp;q=" rel="nofollow">http://code.google.com/p/amarino/downloads/detail?name=SensorGraph_02.zip&amp;can=2&amp;q=</a></p>
  
  <p>This creates an oscilloscope graph based on external sensor activity, and I need to save the image (currently a bitmap) as a JPEG to the Android phone Image Gallery. I would like to do so using a button.</p>
  
  <p>I have enabled OnClickListener in my SensorGraph class, an extension of the Activity class; however, the actual bitmap is created in the View class.</p>
  
  <p>I would appreciate if someone could provide some code to help me save the bitmap.
  I can also use a general "OnClick" command in the main.xml file; however, I believe that the method specified there would just refer back to the Activity class, so I still do not know how to save a bitmap created in the View class using a method in the Activity class.</p>
  
  <p>Thank you very much.</p>