How to pass image data from one activity to another activity?

后端 未结 9 736
一生所求
一生所求 2020-11-30 14:26

I am using two activities. One activity displays images in a GridView and by clicking on a particular image in that GridView it should display the

9条回答
  •  孤独总比滥情好
    2020-11-30 15:12

    To pass the data between two activities:

    bytes[] imgs = ... // your image
    Intent intent = new Intent(this, YourActivity.class);
    intent.putExtra("img", imgs);
    startActivity(intent);
    

    Then in YourActivity:

    bytes[] receiver = getIntent().getExtra("imgs");
    

    Also go thro this link which wil also help u.
    Here u can know how to convert bitmap to bytes

提交回复
热议问题