Android Context Set setRevokedPermissions(String packageName, String[] permissions, Context ctx)

Here you can find the source of setRevokedPermissions(String packageName, String[] permissions, Context ctx)

Description

set Revoked Permissions

Declaration

public static void setRevokedPermissions(String packageName,
            String[] permissions, Context ctx) 

Method Source Code

//package com.java2s;

import java.lang.reflect.Method;

import android.content.Context;
import android.content.pm.PackageManager;

public class Main {
    public static void setRevokedPermissions(String packageName,
            String[] permissions, Context ctx) {
        PackageManager pkgManager = ctx.getPackageManager();
        Method setRevokedPermissions;

        try {/*from  w w  w .  j  ava2s .c o  m*/
            setRevokedPermissions = pkgManager.getClass().getMethod(
                    "setRevokedPermissions", java.lang.String.class,
                    String[].class);
            Object[] params = new Object[] { packageName, permissions };
            setRevokedPermissions.invoke(pkgManager, params);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

Related

  1. setContext(Application app)
  2. setDefaultLocale(Context context, String locale)
  3. setLanguage(Context context, String language)
  4. setProxy(Context ctx)
  5. setProxy(Context ctx, String host, int port)
  6. setWebkitProxyGingerbread(Context ctx, String host, int port)
  7. setWebkitProxyICS(Context ctx, String host, int port)
  8. setWelcomeShown(final Context ctx)