Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static boolean hasPermission(Context context, String permission) {
        if ((context == null) || (permission == null)) {
            return false;
        }
        return context.checkPermission(permission, Process.myPid(), Process.myUid()) == 0;
    }
}