check For Permission - Android android.content

Android examples for android.content:Context

Description

check For Permission

Demo Code


//package com.java2s;
import android.content.Context;

public class Main {
    public static boolean checkForPermission(String permission,
            Context context) {/*  w  w  w .  j  ava 2  s .  c om*/
        return context.checkCallingOrSelfPermission(permission) == 0;
    }
}

Related Tutorials