Category Archives: Marshmallow

onRequestPermissionsResult not called on Fragments in Android

By | October 12, 2016

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 Android Marshmallow.

By | July 29, 2016

Below example asks for camera permission in an Android Marshmallow Device. 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 “Never ask again” then check… Read More »