Android/소스

FileUriExposedException 안드로이드 n(sdk 24)에러잡기.(sdcard)

므시칸곰틔군 2017. 4. 19. 12:14


FileUriExposedException 안드로이드 n(sdk 24)에러잡기.(sdcard)




file:// scheme is now not allowed to be attached with Intent on targetSdkVersion 24 (Android Nougat). And here is the solution.

https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en


사이트에 자세히 나와있으나......

외장sdcard는 안됨...

검색..후

<?xml version="1.0" encoding="utf-8"?>

<paths xmlns:android="http://schemas.android.com/apk/res/android">

    <external-path

        name="external_files"

        path="."/>

    <external-path

        name="external_storage_root"

        path="."/>

    <root-path

        name="root"

        path="/"/>