Same crashing problem:
        Camera.PictureCallback mPictureCallback = new
Camera.PictureCallback() {
                public void onPictureTaken(byte[] data, Camera camera) {
                startImageProcess(data);

                }
        };

        public void startImageProcess(byte[] data)
        {

                Intent mI = new Intent(this, ProcessImage.class);
                mI.putExtra("com.games.imagehunt.myImg", data);
                startActivity(mI);
        }

------------------
public class ProcessImage extends Activity{

        public void onCreate(Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);


                Intent thisIntent = this.getIntent();
                byte[] data =
thisIntent.getByteArrayExtra("com.games.imagehunt.myImg");
<crash>


I also tried it using thisIntent.getByteArrayExtra("myImg"), same
crash. No error message.

On Jul 31, 1:32 pm, RichardC <richard.crit...@googlemail.com> wrote:
> You added a Bundle to the Intent so you should get a Bundle from the
> the Intent and then get the array from the Bundle.
>
> put: Intent      putExtra(String name, Bundle value)
> get: Bundle      getExtras()
>
> or
>
> put: Intent      putExtra(String name, byte[] value)
> get: byte[]      getByteArrayExtra(String name)
>
> but not
>
> put: Intent      putExtra(String name, Bundle value)
> get: byte[]      getByteArrayExtra(String name)
>
> On Jul 31, 5:58 pm, Arascii <jacobw...@gmail.com> wrote:
>
>
>
> > Hi,
> > This seems like a very simple question with a simple answer except I
> > haven't been able to find said answer anywhere.
> > I've taken a picture using the camera, I have a byte array called
> > data, which I want to pass to another class to process.
> > Here's how I package the data:
>
> > Camera.PictureCallback mPictureCallback = new Camera.PictureCallback()
> > {
> >                 public void onPictureTaken(byte[] data, Camera camera) {
> >                 startImageProcess(data);
>
> >                 }
> >         };
>
> >         public void startImageProcess(byte[] mBmp)
> >         {
>
> >                 Intent mI = new Intent(this, ProcessImage.class);
> >                 Bundle myBundle=new Bundle();
> >                 myBundle.putByteArray("mBmp",mBmp);
> >                 mI.putExtras(myBundle);
> >                 startActivity(mI);
> >         }
> > This part seems to work fine. However, when it starts the ProcessImage
> > activity, I get a crash when the following code is called:
> > public class ProcessImage extends Activity{
>
> >         public void onCreate(Bundle savedInstanceState)
> >         {
> >                 super.onCreate(savedInstanceState);
>
> >                 Intent thisIntent = this.getIntent();
> > <crash>    byte[] data = thisIntent.getByteArrayExtra("mBmp");
>
> > I've tried many different combinations of getExtra, getExtras,
> > getByteArrayExtra, etc. I've also tried different methods for
> > inserting the extra. I'm at the end of my rope. Could someone please
> > help?
> > Thanks,
> > Arascii

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to