title: pick image from gallery and convert into byte data how?
body: <p>I need to pick an image from gallery and then convert it into byte data. I know how to pick image from gallery. Also I know how to convert image to byte data. But problem is i convert image that are in drawable but now I need to pick it from gallery and convert it to byte code. Any help 
  THanks
  In onClick function I am using this code to pick image from gallery</p>
  
  <pre><code>Intent image = new Intent(Intent.ACTION_GET_CONTENT);
          image.setType("Image/*");
          startActivityForResult(image, 0);
  </code></pre>
  
  <p>And I have used following code to convert image that is in drawable to byte data.</p>
  
  <pre><code> bm = BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);
         data = new ByteArrayOutputStream(); 
         bm.compress(Bitmap.CompressFormat.JPEG, 40 , data);
       bitmapdata = data.toByteArray();
  </code></pre>
  
  <p>Now how would i convert image from gallery to byte data.
  Thanks</p>