public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
          int iPermission = PERMISSIONS[position];
          iPermission++;
          if (iPermission > 3) {
            iPermission = 1;
          }

          PERMISSIONS[position] = iPermission;
          // String strUniqueId = ConfigurationDatabase.getUniqueId(PACKAGENAMES[position],
          // CLASSNAMES[position]);
          // mPermissionDatabase.updateEntry(strUniqueId, iPermission);
          mPermissionDatabase.updateEntry(PACKAGENAMES[position], iPermission);

          view.invalidate();
          mAdapter.notifyDataSetChanged();
        }
 @Override
 public void handleMessage(Message msg) {
   mNumberOfApplications = msg.what;
   mAdapter.notifyDataSetChanged();
   super.handleMessage(msg);
 }