Deprecated “getBitmap” with API 29. Any alternative codes?

前端 未结 9 2222
渐次进展
渐次进展 2020-12-15 20:25

My onActivityResult is not working because getBitmap is deprecated, any alternative codes to achieve this?

here are the codes that needs to

9条回答
  •  攒了一身酷
    2020-12-15 21:01

    It was evident that the getBitmap API doesn't work with the latest Android SDK - 29. So, this worked for me

    Uri contentURI = data.getData();
    try {
        imageView.setImageURI(contentURI);
    } catch (Exception e) {
        e.printStackTrace();
    }
    

    Please let me know if this doesn't work for any of you, shall other options!

提交回复
热议问题