The samples in this directory showcase how to request single and multiple permissions using the ActivityResultContracts API part of:
- androidx.activity, version 1.2.0 or later
- or androidx.fragment, version 1.3.0 or later
In addition, it showcases how to request permissions in Jetpack Compose using accompanist-permissions library.
Important: All samples run independent of each other but the permission status are shared since they are part of the same app. Thus accepting or revoking a permission in one sample might affect the other.
While these samples follow the recommended flow when requesting permissions, code and UX is simplified for brevity. For more check out the documentation at https://developer.android.com/guide/topics/permissions/overview
Copyright 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.