0

I have been at this for hours now and I just have no idea on how to pass a byte[] array to another view when I call OnItemClick. I have tried converting the byte array to a string and back but that doesn't work. I can't do get(position) like I could on a normal string array.

Sorry if this is basic but I honestly have no clue on how to due this.

@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
    if (view.equals(footerView)) {
        footerView.showProgress();
        List<Status> olderTimeline = loadOlderTweets();
        insertTimeline(olderTimeline);
        attachAdapter();
    } else {
        // i want to do something like this on the byte[] array
        result_pos = timeline_arg.get(position);
        Intent i = new Intent(getSherlockActivity(), TDetailActivity.class);
        i.putExtra("username", result_pos.get("username"));
    }
}
isaias-b
  • 2,255
  • 2
  • 25
  • 38
jsmos
  • 497
  • 2
  • 5
  • 15

2 Answers2

0
Intent intent = new Intent(this, SomeActivity.class);
Bundle extras = intent.getExtras();
extras.putByteArray(key, value);

Then, in the launched Activity, you would read them via:

byte[] value = getIntent().getExtras().getByteArray(key)
0

Send your byte array as

Intent in1 = new Intent(this, TDetailActivity.class);
in1.putExtra("image",byteArray);

And in TDetailActivity retrieve byte array as

byte[] byteArray = getIntent().getByteArrayExtra("image");

Change image with the key of your byte array.

Giru Bhai
  • 14,370
  • 5
  • 46
  • 74