0

Hello I am trying to enable the "Device Administrator" of my application that is working perfectly but I want in "Device Administrator" settings, under my application it should show some hint about my application. I didn't find the way to do this.

I'm enabling the "Device Administrator" like below

Intent intent = new Intent(
        DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,
        mComponentName);
intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
        "Funny stuff !");
startActivityForResult(intent, 1);

enter image description here

Any idea to set the hint under my application "Demo" ?

N Sharma
  • 33,489
  • 95
  • 256
  • 444

1 Answers1

2

Step #1: Define your "hint" as a string resource.

Step #2: Add a reference to that string resource as the android:description of your <receiver> element for your DeviceAdminReceiver subclass:

<receiver android:name=".app.DeviceAdminSample"
  android:label="@string/sample_device_admin"
  android:description="@string/sample_device_admin_description"
  android:permission="android.permission.BIND_DEVICE_ADMIN">
  <meta-data android:name="android.app.device_admin"
    android:resource="@xml/device_admin_sample" />
  <intent-filter>
    <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
  </intent-filter>
</receiver>
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491