Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Taking Picture From Android Camera Issue on multiple Devices

Taking Picture From Android Camera Issue on multiple Devices

Put your problem here if it does not fit any of the other categories.

Taking Picture From Android Camera Issue on multiple Devices

Postby mr_muskuraha » Mon Dec 31, 2012 9:09 pm

I have been facing strange issue and at least i have tried every alternative way, technique to take picture from camera through intent, saving it to SD card etc..

even exploring whole stackoverflow and Google as well to get solution but i found nothing relevant to my problem.

Problem is: I take picture from camera it works on few phones and many phones just crash, Google says use this code to take picture but it does not work on all devices either :(

Code: Select all
Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            File dir=
                Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);

            output=new File(dir, "CameraContentDemo.jpeg");
            i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(output));

            startActivityForResult(i, CONTENT_REQUEST);


@Override
      protected void onActivityResult(int requestCode, int resultCode,
                                      Intent data) {
        if (requestCode == CONTENT_REQUEST) {
          if (resultCode == RESULT_OK) {

              Uri selectedImage = Uri.fromFile(output);
                getContentResolver().notifyChange(selectedImage, null);
                ImageView imageView = (ImageView) findViewById(R.id.imageView1);
                ContentResolver cr = getContentResolver();
                Bitmap bitmap;
                try {
                     bitmap = android.provider.MediaStore.Images.Media
                     .getBitmap(cr, selectedImage);

                    imageView.setImageBitmap(bitmap);
                    Toast.makeText(this, selectedImage.toString(),
                            Toast.LENGTH_LONG).show();
                } catch (Exception e) {
                    Toast.makeText(this, "Failed to load", Toast.LENGTH_SHORT)
                            .show();
                    Log.e("Camera", e.toString());
                }

          }
        }
      }


It Works On these Phones:

    Samsung Galaxy S1,S2
    Sumsung Ace
    Motorola Droid
    Droid Razr Maxx HD

It Does Not Work On these Phones:
    Droid Razr Maxx w
    Xoom tablet

Please put some light on it, whether my code is incorrect or these phones have some issue?

any help would be appreciated.
mr_muskuraha
Senior Developer
Senior Developer
 
Posts: 142
Joined: Wed Jan 13, 2010 8:49 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests