Tag Archives: requestPermissions

onRequestPermissionsResult not called on Fragments in Android

By | June 21, 2022

This is a common mistake that people make when coding for marshmallow. When in AppCompatActivity, you should use ActivityCompat.requestPermissions; When in android.support.v4.app.Fragment, you should use simply requestPermissions (this is an instance method of android.support.v4.app.Fragment) If you call ActivityCompat.requestPermissions in a fragment, the onRequestPermissionsResult callback is called on the activity and not the fragment. If you… Read More »

Simple Example on using CAMERA Access permission in versions greater than Android Marshmallow.

By | December 28, 2018

Below example asks for camera permission in versions greater than Android Marshmallow. Watch Video Tutorial Add Camera permission to the manifest For asking for permission you can call like this. To Check if the user has permission to access camera.   Now the Callback if the User has performed any action. if the user clicks… Read More »