-5
Bitmap r = imagelist[args.Position].Data;
byte[] arr = getByteFromBitmap(r);
var activity2 = new Intent(this, typeof(FullScreenImageViewActivity));
activity2.PutExtra("FullImage", arr);
StartActivity(activity2);

I get the correct byte[] and put it in the intent. But it never takes me to the other activity so the code below won't be triggered.

byte[] b = Intent.GetByteArrayExtra("FullImage");
Bitmap bitmap = BitmapFactory.DecodeByteArray(b, 0, b.Length);
imageView.SetImageBitmap(bitmap);
Daniel Puiu
  • 962
  • 6
  • 21
  • 29
Daniel Gustafsson
  • 1,725
  • 7
  • 37
  • 78

2 Answers2

0
  1. You shouldn't be using typeof in the intent parameters.
    It should go:

    var activity2 = new Intent(this, FullScreenImageViewActivity.class);  
    
  2. You're using putExtra on a Bitmap, but trying to extract a byte array in the 2nd activity. This will not end well.

Daniel Puiu
  • 962
  • 6
  • 21
  • 29
Moonbloom
  • 7,738
  • 3
  • 26
  • 38
0

Try this code.....

To Pass Intent..

byte[] arr = YOURBYTEARRAY;

Intent intent= new Intent(this, FullScreenImageViewActivity.class);
intent.PutExtra("FullImage", arr);
StartActivity(intent);

To Get Intent Value..

byte[] b = getIntent().getByteArrayExtra("FullImage")
Pragnesh Ghoda シ
  • 8,318
  • 3
  • 25
  • 40