Selecting image from gallery not working on Redmi Note 4

蓝咒 提交于 2019-12-01 20:55:57

So I was able to narrow down the issue to an incorrect file path. The Uri to filepath function did not get the desired result on all devices.

I used the approach suggested here:https://stackoverflow.com/a/7265235/3438497

and tweaked the code a little bit so that when picking images from gallery, I use the Uri of the image directly.

I am facing the similar issue in Redmi 5A. And solve the problem using following way.

Add below entities in your manifest file

android:hardwareAccelerated="false"

android:largeHeap="true"

It will work in some environments.

Refer answer at https://stackoverflow.com/a/32245018/2706551

The reason is that you get file:// uri back. not content:// so content resolver doesn't work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!