Cannot always launch DevicePolicyManager activity from another activity

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

Sponsored Links

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
{ (has extras) }
WARN/InputManagerService(104): Window already focused, ignoring focus
gain of:$Stub

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);

But I cannot launch the DevicePolicyManager with:

        //This works from main activity, but not from QuestionActivity
        MyDeviceAdmin admin = new MyDeviceAdmin(this);
        Intent intent = new
                "Additional text explaining why this needs to be
        startActivityForResult(intent, 234234234);

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


Other Threads

1. Looking for information on the Fragment dump() method (FragmentManager too)

Both of these classes have a dump() method which looks useful for
debugging. I tried to use them in a sample application, but I'm not
getting any output at all. My code looks like this from within my

        public void dumpFragmentMgr() {
                FragmentManager fm = getFragmentManager();
                File dumpFile = new 
File(Environment.getExternalStorageDirectory() +
                if(dumpFile.exists()) {
                try {
                    FileOutputStream fos = new FileOutputStream(dumpFile, true);
                    fm.dump("DIALOG", fos.getFD(), new PrintWriter(fos),
                } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                } catch (IOException e) {
                        // TODO Auto-generated catch block

I'm positive that I have fragments in my fragment manager. My output
file is always empty, although I can see the datetimestamp getting
updated. I'm always passing null for the 4th argument to dump() since
I have no idea what else to put there. I have enableDebugLogging set
to true. Any help please?


2. Beta Game Space Bike

here are some download links
check it out.
tell people about it, if you know any reviewers give them a link,
also post problems, bugs, questions, suggestions


3. Clear data from MediaStore

4. Draw Image next to text on canvas

5. Maps not working in the android emulator

6. noob question I guess - input requires enter key

7. Simple Search App -- Help Required