I have an app which just has a service in it. So it doesnt have an
activity. I want to call the wipeData() api from it.
I have followed an example which sets up the DevicePolicyManager from
inside the onCreate of an Activity class. That works fine.

Q1: My example only works if the mDeviceAdminSample is created as
below. If I try to create the mDeviceAdminSample  using new
ComponentName((String pkg, String cls) then I dont get a popup window
asking the user to confirm the new policies. Do I have to create the
ComponentName using a context and a class?

mDeviceAdminSample = new ComponentName(this, DeviceAdminSample.class);
...
intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,
mDeviceAdminSample);

Q2: If I setup the device policy from one app, can I use those
policies from another app?
The problem seems to me to be the...
mDeviceAdminSample = new ComponentName(this, DeviceAdminSample.class);
If it has to be created using a context then how can you use it from
another app?

Q3: Basically I have an app with just a service and I dont know how I
can call wipeData from it. I dont know how to create the
mDeviceAdminSample to hook into policies that have already been
created.

Many thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to