0

protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id);

    ApplicationInfo app = applist.get(position);
    for (PackageInfo pi : appList) {            
        // Do not add System Packages
        if ((pi.requestedPermissions == null || pi.packageName.equals("android")) || 
                (pi.applicationInfo != null && (pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)) 
            continue;


        for (String permission : pi.requestedPermissions) {
            Map<String, String> curChildMap = new HashMap<String, String>();
            try {
                PermissionInfo pinfo = mPm.getPermissionInfo(permission, PackageManager.GET_META_DATA);
                CharSequence label = pinfo.loadLabel(mPm);
                CharSequence desc = pinfo.loadDescription(mPm);
            } catch (NameNotFoundException e) {
                Log.i(TAG, "Ignoring unknown permission " + permission);
                continue;
            }
        }
    }
}

hii everyone am trying to show the permission used by the application in android..i have listed the set of installed app by using the coding on the following link(http://javatechig.com/android/how-to-get-list-of-installed-apps-in-android)but i have tried a lot of changes on it to show the permission but it does not work.am in great need of it please some one tell me how can i make it..above is my code onclick listner but its not working

arvind AK
  • 31
  • 4

0 Answers0