@Override
 protected void onDestroy() {
   if (mPermissionDatabase != null) {
     mPermissionDatabase.close();
   }
   super.onDestroy();
 }
        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();
        }