Android application crash when picking photo on new devices

后端 未结 3 941
我寻月下人不归
我寻月下人不归 2021-02-10 00:51

In my application users select picture from gallery and upload. On many devices my code works perfect but on new devices (etc: samsung S5, LG G2, Samsung S4) application crashes

3条回答
  •  失恋的感觉
    2021-02-10 00:57

    in this tutorial used an util class which is handling all types of images from different sources. https://www.simplifiedcoding.net/upload-pdf-file-server-android/ you have to do just, in on onActivityResult method String path = FilePath.getPath(this, filePath); you will get right path, across every device and every source of app which are providing images(FilePath class will available in above tutorial link)

提交回复
热议问题