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. clear contact

malam smua,,

bgini, sebelumnya ane naek ke samdroid 1.0.3 ane udah export data contact ke
file karena bakal ilang deh tu data2.
habisnya itu setelah jalan normal lagi, ane import lagi dari file tersebut,
pertama gak balik, kedua gak balik. akhirnya ane import untuk ketiga kali.

nah,,,ternyata pas ane cek nomor telepon yang ada di contact malah berlipat
jadi 3 kali. jadi misal 1 nama tapi nomor yg ada didalamnya 3 dan sama
smua,,

sekarang penyelesaiannya gimana ya? udah ane coba sync ke contact gmail, tp
ttp aja,,

mau clear data contact gimana ya? ada yang bisa kasih pencerahan,


terima kasih,,

-- 
This transmission may contain confidential or privileged material. Any use
of
this information by anyone other than the intended recipient is prohibited.
If
you have received this transmission in error, please immediately throw away
your computer because this message will explode in 10 second.

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

2. why can't i build an AVD with a 2G SD card?

just jumping into using the android 2.2 SDK and emulator on my
ubuntu 10.04 system, and an initial attempt to build a virtual device
with a 2G card gave me

  "Error: SD Card size must be at least 9MB."

um ... huh?  i verified that sizes of 256M, 512M, 1G and 1.5G all
work, but 2G is weirdly rejected as above.  thoughts?

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

-- 

3. changing the icon for an app?

4. Best practices for creating multiple app versions from a single codebase?

5. highlighting a coloured item in a ListView

6. Perkenala

7. Bluetooth question regarding observing a pairing