Passing an image from one activity to other activity

前端 未结 3 1369
礼貌的吻别
礼貌的吻别 2020-12-18 16:21

I am trying to pass an image which is from the mobile media. I am able to get the image from the media but I need to send that image to the next activity. How can I send tha

3条回答
  •  鱼传尺愫
    2020-12-18 16:42

    You can use like:

    I suppose that: send image to Activity B from A

    Actvity: A

      Intent i = new Intent(A.this,B.class);
    
      i.putExtra("image_send",bitmap)
      //with bitmap is image that you want to send.
      startActivity(i);
    

    Activity B:

      //receive image
      Bitmap b = (Bitmap) getIntent().ParcelableExtra("image_send")
    

提交回复
热议问题