DeviceAdminReceiver


public class DeviceAdminReceiver
extends BroadcastReceiver

java.lang.Object
   ↳ android.content.BroadcastReceiver
     ↳ android.app.admin.DeviceAdminReceiver


Base class for implementing a device administration component. This class provides a convenience for interpreting the raw intent actions that are sent by the system.

The callback methods, like the base BroadcastReceiver.onReceive() method, happen on the main thread of the process. Thus long running operations must be done on another thread. Note that because a receiver is done once returning from its receive function, such long-running operations should probably be done in a Service.

When publishing your DeviceAdmin subclass as a receiver, it must handle ACTION_DEVICE_ADMIN_ENABLED and require the Manifest.permission.BIND_DEVICE_ADMIN permission. A typical manifest entry would look like:

<receiver android:name="