bitmapfactory decodeByteArray null pointer error

All your problems with Audio, Video and Images.

bitmapfactory decodeByteArray null pointer error

Postby althejandro » Tue Mar 08, 2011 1:24 am

I'm trying to pass a byte array from an image to an activity through a bundle
when i try to decode array into a bitmap i get a null pointer exception which FC's (running on physical phone)
I've been going through line by line and this is the only thing creating an error

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.                 //grab byte array taken
  3.                 Intent sent = this.getIntent();
  4.                 Bundle arrayForPic = sent.getExtras();
  5.                 byte[] picArray = arrayForPic.getByteArray("pictureArray");
  6.                
  7.                 //convert array into bitmap
  8. //null error happens HERE
  9.                 Bitmap thumbnail = BitmapFactory.decodeByteArray(picArray, 0, picArray.length);
  10.  
  11.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


I've been searching for hours! please help!
althejandro
Freshman
Freshman
 
Posts: 3
Joined: Sun May 30, 2010 5:57 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google Feedfetcher and 10 guests