Android Context Get getPermissionLabel(Context context, String permission)

Here you can find the source of getPermissionLabel(Context context, String permission)

Description

get Permission Label

License

Open Source License

Declaration

public static CharSequence getPermissionLabel(Context context,
            String permission) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static CharSequence getPermissionLabel(Context context,
            String permission) {/* w w  w. j a  va2  s . com*/
        try {
            final PackageManager pm = context.getPackageManager();
            return pm.getPermissionInfo(permission, 0).loadLabel(pm);
        } catch (NameNotFoundException e) {
            return permission;
        }
    }
}

Related

  1. getPackageName(final Context context)
  2. getPackageVersion(Context c)
  3. getPackageVersionAsInt(Context c)
  4. getPath(Context context, Uri uri)
  5. getPathFromUri(Context context, Uri uri)
  6. getPreferences(Context context, String campaignUrn)
  7. getPrefs(Context context)
  8. getRealPathFromURI(Context context, Uri contentUri)
  9. getReceiverMetaData(Context context, Class receiverClass, String key)