This is how I did, it works for me. Thanks!
For Activity :
ActivityCompat.requestPermissions(this, permissionsList, REQUEST_CODE);
For Fragment :
requestPermissions(permissionsList, REQUEST_CODE);
More Related Contents:
- onActivityResult() not called in new nested fragment API
- How to hide the soft keyboard inside a fragment?
- Translate java widget to kotlin [duplicate]
- Room database created in Kotlin, activity written in Java, can I do that?
- Formatting Double to String? [duplicate]
- Unfortunately MyApp has stopped. How can I solve this?
- Why does my function that calls an API return an empty or null value?
- Alarm Manager Example
- The AsyncTask API is deprecated in Android 11. What are the alternatives?
- How to make an Android device vibrate? with different frequency?
- Replacing a fragment with another fragment inside activity group
- Android M Permissions: onRequestPermissionsResult() not being called
- Why does my function that calls an API or launches a coroutine return an empty or null value?
- Android search with Fragments
- android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify
- How to send data from DialogFragment to a Fragment?
- Why is accessing TextView of a Fragment inside Activity throwing an error
- JCenter deprecation; impact on Gradle and Android
- Android FragmentManager BackStackRecord.run throwing NullPointerException
- RecyclerView not calling onCreateViewHolder or onBindView
- Android – ImageLoader must be init with configuration before using in UIL
- How to exclude an element from a Firestore query?
- What is the best way to declare on UI component in android with Kotlin?
- How to change fragments using Android navigation drawer
- incompatible types: HomeFragment cannot be converted to Fragment in Android
- Android Failed to instantiate one or more classes
- How to pass data from Recyclerview to Fragment
- How to update edittext whenever a quantity is added in android studio
- How I can use callback in Kotlin?
- Request runtime permissions from v4.Fragment and have callback go to Fragment?