How to display selfshot capture image in camera in imageview in android
<p>I am taking user picture using self shot option in  default camera in android and display it in image view in galaxy tab 7inch using android2.2  but its not displaying my code is below can anybody tell what is problem? but taking in back camera its working for self shot its not working </p>

<pre><code>  startActivityForResult(new Intent("android.media.action.IMAGE_CAPTURE"), 7);
</code></pre>

<p>public void onActivityResult(int requestCode, int resultCode, Intent data)
    {</p>

<pre><code>f (requestCode == 7) {
            if (resultCode == RESULT_OK) {



                final ContentResolver cr = getContentResolver();    
                final String[] p1 = new String[] {
                                MediaStore.Images.ImageColumns._ID,
                                MediaStore.Images.ImageColumns.DATE_TAKEN
                };
                Cursor c1 = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, p1, null, null, p1[1] + " DESC");      
                if ( c1.moveToFirst() ) {

                       String uristringpic = "content://media/external/images/media/" +c1.getInt(0);
                       Uri newuri = Uri.parse(uristringpic);
                       ImageView icon= (ImageView) findViewById(R.id.img);
                       icon.setImageURI(newuri);
             }
                c1.close();
}
}
</code></pre>

<p>}</p>
