has Internet Permission - Android Network

Android examples for Network:Internet

Description

has Internet Permission

Demo Code


//package com.java2s;

import android.content.Context;

public class Main {
    public static boolean hasInternetPermission(Context context) {
        if (context != null) {
            return context
                    .checkCallingOrSelfPermission("android.permission.INTERNET") == 0;
        }//from w ww  .ja v  a 2  s  . co  m
        return true;
    }
}

Related Tutorials