title: Lock device using DeviceAdminReceiver
body: <p>i am try to lock the device using DeviceAdminReceiver and try to enable administration like following:</p>
  
  <pre><code>if (!mDPM.isAdminActive(mDeviceAdminSample)) {
    Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN)
    intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminSample);
    intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, "Additional text explaining why this needs to be added.");   startActivity(intent);
   }
  </code></pre>
  
  <p>and getting error something like the following:</p>
  
  <blockquote>
    <p>ERROR/Error(1022):
    java.lang.SecurityException: No active
    admin owned by uid 10045 for policy #3</p>
  </blockquote>
  
  <p>kindly give me some code solutions and how to enable the administration permission.</p>