Note that there are some explanatory texts on larger screens.

plurals
  1. PO"take a picture and present it" in portrait mode on Samsung Galaxy S
    primarykey
    data
    text
    <p>I am trying to simply take a picture and present it in an ImageView with my samsung galaxy s. it's working fine when I do it on landscape but <strong>not</strong> on portrait. I am not getting any error or exception - just not getting anything... There is a lot of questions about this topic and it seems to be problematic (something about camera orientation) but counldn't figure out the final solution for a simple "take a picture and present it" code. here is my (problematic) code that doesn't work:</p> <pre><code>private void setUpListeners() { takePicture.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); } }); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == CAMERA_PIC_REQUEST) { Log.d("onActivityResult", "CAMERA_PIC_REQUEST returned"); dishImage = (Bitmap) data.getExtras().get("data"); if (dishImage==null) Log.d("onActivityResult", "dishImage==null"); imageView = (ImageView) findViewById(R.id.dishinfodishimageview); imageView.setImageBitmap(dishImage); imageView.setVisibility(View.VISIBLE); takePicture.setVisibility(View.GONE); (new UploadImage()).execute(null); } } else { Log.e("onActivityResult", "no able to presenting the picture of the dish"); } </code></pre> <p>}</p> <p>I just need a code that works (on any device) or a fix to my code... thx. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

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