Cannot always launch DevicePolicyManager activity from another activity

by cpphool » Fri, 04 Mar 2011 21:25:36 GMT


Sponsored Links
 Hi,

I have some strange problem. When I try to launch DevicePolicyManager
activity from my main activity, it loads properly. However, when I
make a notification, call QuestionActivity (if user clicks the
notification), and then try to call DevicePolicyManager activity from
QuestionActivity, I get (logcat):

INFO/ActivityManager(104): Starting activity: Intent
{ act=android.app.action.ADD_DEVICE_ADMIN
cmp=com.android.settings/.DeviceAdminAdd (has extras) }
WARN/InputManagerService(104): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub
$Proxy@4514a2d0

And nothing appears. This is strange for me, cause I'm able to launch
different Android OS activity from QuestionActivity:

        //This works
        Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
        startActivity(intent);

But I cannot launch the DevicePolicyManager with:

        //This works from main activity, but not from QuestionActivity
        MyDeviceAdmin admin = new MyDeviceAdmin(this);
        Intent intent = new
Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
        intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,
                 admin.getDeviceAdminComponent());
        intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
                "Additional text explaining why this needs to be
added.");
        startActivityForResult(intent, 234234234);

I would be very grateful for any help, cause I'm completely stuck.

-- 



Other Threads

1. N1 Resmi

Halo RR,
Apakah mungkin N1 (google) menjual N1 via Dirjen Postel ? Bukan BM spt yg skg ?

Powered by Telkomsel BlackBerry

-- 
"Indonesian Android Community [id-android]" 

2. DB Android Blogger & Android Developer

Hi,

What's the Difference Between Android Blogger & Android Developer?...


-- 
Thanks & Regards
Sasikumar.S

-- 

3. Keyboard Typing Error

4. GridView for Buttons, not images

5. Another flight information apk

6. eclipse help cant find canvas?

7. TextView with Clear Button