简体   繁体   中英

How to download and open a PDF in Android 11 Xamarin Forms

I could able to download and open that PDF using PDF reader before targeting Android 11. Now PDF download to the app specific storage location. According to the new policy other third party apps have no access to that location. So how can I open and show that PDF? There is no specific direction to follow. Is there any way to open the PDF without saving it? PDF data coming as a byte[]

According to the official documentation, starting in Android 11, apps cannot create their own app-specific directory on external storage.

You can no longer use the ACTION_OPEN_DOCUMENT_TREE or the ACTION_OPEN_DOCUMENT intent action to request that the user select individual files from the following directories: The Android/data/ directory and all subdirectories. The Android/obb/ directory and all subdirectories.

You can check the path settings you are using, For more information, please see https://developer.android.com/about/versions/11/privacy/storage#file-directory-restrictions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM