Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>On a Galaxy S3 with CM 10.1 I get a nullpointer exception in BitmapHelper:</p> <blockquote> <p>bm = BitmapFactory.decodeFileDescriptor(fileDescriptor.getFileDescriptor(), null, options);</p> </blockquote> <p>subsequently my UploadPhotoActivity fails at:</p> <blockquote> <pre><code> try { photo = BitmapHelper.readBitmap(this, cameraPicUri); if (photo != null) { photo = BitmapHelper.shrinkBitmap(photo, 600, rotateXDegrees); thumbnail = BitmapHelper.shrinkBitmap(photo, 100); ImageView imageView = (ImageView) findViewById(R.id.sustainable_action_photo); imageView.setImageBitmap(photo); } else { Log.e(TAG,"IMAGE ERROR 1"); } } catch (Exception e) { Log.e(TAG,"IMAGE ERROR 2"); e.printStackTrace(); } </code></pre> </blockquote> <p>at the second log (IMAGE ERROR 2). After a couple of tries my camera broke and I got a "Could not connect to camera"-error.</p> <p>Tested it on a nexus 7 and it works perfectly.</p> <p>Edit: Narrowed it down to this:</p> <blockquote> <p>fileDescriptor = context.getContentResolver().openAssetFileDescriptor(selectedImage, "r");</p> </blockquote> <p>Although selectedImage contains this:</p> <blockquote> <p>file:///storage/emulated/0/DCIM/Camera/IMG_20131023_183343.jpg</p> </blockquote> <p>The fileDescriptor returns a FileNotFoundException. I checked the file system and the image is not saved at this location. The cameraPicUri in TakePhotoActivity points to a non existant image. I am currently checking where it all goes wrong.</p> <p>Edit2: I figured out the error: Since the device is a Samsung, and tells the App that it is a Samsung device, your Samsung specific fixes are applied. Cyanogenmod does not need those fixes though, and in the end the code breaks. Once you remove</p> <blockquote> <p>(manufacturer.contains("samsung")) &amp;&amp;</p> </blockquote> <p>It works. Since this is a custom ROM you could not plan for that of course. I am trying to figure out a way to detect if the device is running cyanogenmod and then include this in your code. </p> <p>Thanks for a nice camera fix!</p> <p>Edit3: <strike>I fixed it to run on Cyanogenmod on the Galaxy S3 by changing your code to this:</strike> Well, now it sometimes works, sometimes it does not. Strange.</p> <blockquote> <p>if (getPackageManager().hasSystemFeature("com.cyanogenmod.android") || (!(manufacturer.contains("samsung")) &amp;&amp; !(manufacturer.contains("sony")) &amp;&amp; !(manufacturer.contains("lge"))))</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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