yanzhenjie / Album

:watermelon: Album and Gallery for Android platform.
https://github.com/yanzhenjie/Album
Apache License 2.0
2.51k stars 507 forks source link

Android Q file support #288

Open kawtikwar opened 4 years ago

kawtikwar commented 4 years ago

How to give support for Android Q?

Want to show all the media images/videos in a grid after targeting API 29?

ntpanchal commented 4 years ago

Support for API 29? It will not display media data and also capture is not working.

WillWolfWang commented 4 years ago

我在一加 7Pro 手机,系统版本为 Android 10 也遇到了这个问题,我把 targetSdkVersion 降到 27 就可以正常显示图片了。

matsushitak commented 4 years ago

You should watch this reference for Android Q. https://developer.android.com/training/data-storage/files/external-scoped

It changes the way that management of storage from Android Q.

You can fix this issue to write this code into AndroidManifest.xml

    <manifest ... >
      <!-- This attribute is "false" by default on apps targeting
           Android 10 or higher. -->
      <application android:requestLegacyExternalStorage="true" ... >
        ...
      </application>
    </manifest>

However, this is a temporary solution. The library's code needs to change.