Getting permission not granted in GingerBread

52 Views Asked by At

I am using following function to check whether read from external storage permission has been granted or not.

public static boolean checkWritePermissions(Context context)
{   String permission = "android.permission.READ_EXTERNAL_STORAGE";
    int res = context.checkCallingOrSelfPermission(permission);
    return (res==PackageManager.PERMISSION_GRANTED);
}

The function is working correctly for post GingerBread devices, however for GingerBread devices the returned value is false. Ignoring the function returned value shows that permission has been granted. Is there any alternative for GingerBread devices.

P.S.: The application isn't using Support Library so new permission methods aren't being used.

0

There are 0 best solutions below