Xiaomi MI device not picking image from Gallery

99封情书 提交于 2020-01-15 12:15:10

问题


I have a very weird issue. I am picking an image from a gallery the code is working properly on all the devices like Nokia 6 , One Plus X. When it comes to xiaomi devices the image is not getting set on ImageView .

Can anyone help me out on how to fix this issue ? I have to pick multiple images.
Code to pick image from gallery

Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
        intent.setType("image/*");
        intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
        startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);

回答1:


Remove multiple images selection if you are selecting then you need to resolve it by Cursor in a new String array.

and also add these two lines in your code:

 android:hardwareAccelerated="false"

   android:largeHeap="true"


来源:https://stackoverflow.com/questions/45014292/xiaomi-mi-device-not-picking-image-from-gallery

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