ParkSangGwon / TedPermission

Easy check permission library for Android Marshmallow
1.74k stars 238 forks source link

[coroutine] dialog box didnt show on Android R #137

Open yogithesymbian opened 2 years ago

yogithesymbian commented 2 years ago
GlobalScope.launch {

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
                Log.d(TAG_LOG, "hello android R")
                val permissionResult = TedPermission.create()
                    .setPermissions(
                        Manifest.permission.MANAGE_EXTERNAL_STORAGE
                    )
                    .checkGranted()
                Log.d(TAG_LOG, "hello $permissionResult")
                if (!permissionResult) {
                    // request
                    Log.d(TAG_LOG, "hello request $permissionResult") // this #line# the dialog didnt show
                } else {
                    Log.d(TAG_LOG, "hello granted $permissionResult")
                }
            } else {
                Log.d(TAG_LOG, "hello android min R")
                val permissionResult = TedPermission.create()
                    .setPermissions(
                        Manifest.permission.READ_EXTERNAL_STORAGE,
                        Manifest.permission.WRITE_EXTERNAL_STORAGE
                    )
                    .checkGranted()
                Log.d(TAG_LOG, "hello $permissionResult")
                if (!permissionResult) {
                    // request
                    Log.d(TAG_LOG, "hello request $permissionResult")
                } else {
                    Log.d(TAG_LOG, "hello granted $permissionResult")
                }

            }
        }

why dialog bo didn appears just throw the log on // this #line#

kocakurt75 commented 1 year ago

Teşekkürler