Display jpg image from intent in imageview

后端 未结 3 457
离开以前
离开以前 2021-01-22 08:36

How to display an Image received from an \"android.intent.action.SEND\" in an imageview? The user selects my app from the list of apps to share an imag

3条回答
  •  广开言路
    2021-01-22 09:03

    Bitmap implements Parcelable interface. So to pass it use

    intent.putExtra("bitmap", bitmap);
    

    and to retrieve it use:

    Bitmap bitmap = (Bitmap) intent.getParcelableExtra("bitmap");
    

    and use ImageView.setImageBitmap().

    EDIT: see Receiving Content from Other Apps

提交回复
热议问题