camera image conversion
<pre><code>    package map.demo;
 public class MapDemoActivity extends Activity {

        Button capture;
        ImageView image;
        int cameracode=100;
        Bitmap bm;
        Boolean result;
        FileOutputStream fos;
        File sd;

        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            capture=(Button)findViewById(R.id.capture);
            capture.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub

                    image=(ImageView)findViewById(R.id.image);
                    Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                    startActivityForResult(i, cameracode);  
                }
            });

        }
        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            // TODO Auto-generated method stub



                        if(requestCode==100)
                        {



                            bm=(Bitmap) data.getExtras().get("data");

                            image.setImageBitmap(bm);


                            image.setDrawingCacheEnabled(true);
                            bm = image.getDrawingCache();

                                if(bm==null)
                                {
                                    Toast.makeText(getApplicationContext(), "Image is null", 1000).show();
                                }
                                else
                                {
                                    try {

                                        fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory(), "image.jpg"));

                                        result=bm.compress(CompressFormat.JPEG, 75, fos);

                                        fos.flush();
                                        fos.close();

                                    } catch (FileNotFoundException e) {
                                        // TODO Auto-generated catch block

                                        e.printStackTrace();
                                    } catch (IOException e) {
                                        // TODO Auto-generated catch block

                                        e.printStackTrace();
                                    }

                            }       
                        }

            super.onActivityResult(requestCode, resultCode, data);
        }
    }
</code></pre>

<p>i am doing above code to capture image from camera and set image to image view
&amp; convert image to jpeg,
But i does not get image, it shows null. i.e in my code bm=null after image capture.
but image view show me image which is by default for camera (i am using emulator to capture image).</p>
