Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid SDK Nexus S native camera issue
    text
    copied!<p>I am developing an app using android native camera. I can successfully take a photo and store and display on ImageView. I am testing on HTC desire Z, Nexus S and Motorola Zoom. It works on all three devices except one issue on Nexus S. When I take a photo using Nexus S, the preview <strong>image has been rotated by 90 degrees</strong>.</p> <p><strong>Can you please let me know how to over come this issue?</strong></p> <p>My code:</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera_preview); imgTakenPhoto = (ImageView) findViewById(R.id.imageView); getPhotoClick(); } private File getTempFile() { return new File(Environment.getExternalStorageDirectory(), "image.tmp"); } private void getPhotoClick() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(getTempFile())); startActivityForResult(intent, REQUEST_FROM_CAMERA); } InputStream is=null; @Override protected void onActivityResult(int requestcode, int resultCode, Intent data){ if (requestcode == REQUEST_FROM_CAMERA &amp;&amp; resultCode == RESULT_OK) { File file=getTempFile(); try { is=new FileInputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); } if(is==null){ try { Uri u = data.getData(); is=getContentResolver().openInputStream(u); } catch (FileNotFoundException e) { e.printStackTrace(); } } Bitmap thumbnail = BitmapFactory.decodeStream(is); imgTakenPhoto.setImageBitmap(thumbnail); } } </code></pre> <p>I have taken help from <a href="https://stackoverflow.com/questions/2696298/problems-saving-a-photo-to-a-file/2741666#2741666">Problems saving a photo to a file</a></p> <p>Many Thanks</p> <p>Anyone please?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload