Search code examples
androidfilelazy-loadingandroid-permissionsandroid-version

Marshmallow cannot load images from lazylist file


Hello i have different images i am loading these images from server using lazy list but its working fine below 6.0 version when i run the same code on 6.0 version its throws exception

java.io.FileNotFoundException: /storage/emulated/0/LazyList/-1246063373: open failed: ENOENT (No such file or directory)

permissions are

 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Anyone please help me why i am getting this exception in 6.0 version


Solution

  • Now for Marshmallow(API Level 23) you need to use run time permission to access contacts or load images from gallery etc etc. You need to check it by run time. You can check below link which provide library and sample project.

    https://github.com/tajchert/Nammu