DEV Community

HARWINDERKAING
HARWINDERKAING

Posted on

I need some help with my jetpack compose code.

Hi there, i hope you are i good health. Recently i got my some hands on jetpack compose and tried to build a small app for gaining experience. Here is the problem that i'm facing below is the code :

 for (permission in permissions){
            val permissionState = rememberPermissionState(permission = permission.permission)
            if (!permissionState.status.isGranted) {
                AccessInfo(
                    accessDetails = permission,
                    isPopupEnabled = false,
                    onDetailLinkClick = { /*TODO*/ },
                    onPopUpButtonClick = { /*TODO*/ },
                    onPermissionResult = { isGranted ->
                        if (isGranted) {

                        }
                    }
                )
            }
        }
Enter fullscreen mode Exit fullscreen mode

The above code works fine it checks for the all permission that are provided in list if those are granted or not if not then ui is generated by passing the permission so user can allow the permission. The code works very well even if the user allow or deny any permission by going to the app setting while the app is running. IT working fine. THe problem is if user denied more than one permission the ui is created again and again over each other. What i want it should be sequential.

Note: I tried all AI tools they are not hitting the correct answer.

Thank you.

Top comments (0)