java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keyStatus/com.keyStatus.keyStatus}: java.lang.SecurityException: No active admin owned by uid 10031 for poli

by amtandroid » Sat, 12 Feb 2011 06:07:14 GMT


Sponsored Links
 Sir please help me....

public class keyStatus extends Activity {
    /** Called when the activity is first created. */
        DevicePolicyManager dpm;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        dpm = (DevicePolicyManager)
getSystemService(Context.DEVICE_POLICY_SERVICE);
        dpm.lockNow();

    }
}



in AndroidManifest.xml


<uses-permission
android:name="android.permission.USES_POLICY_FORCE_LOCK"></uses-
permission>

-- 



Other Threads

1. Eclipse is too slow

Hello

I just installed the latest version of Eclipse IDE for Java Developers
together with the ADT plugin on my Mac (2.8 GHz, 4 GB Ram).

- Opening new files from the package explorer. For example, opening a
layout xml file takes 1-2sec- And the mouse pointer changes.
- Switching between tabs
- Resizing views in the workspace

The performance rapidly decreases when I open more files.

Are all of you developing under these circumstances? How can I speed
up eclipse?

Thanks

-- 

2. Send key event using native methods or low level classes -- possible solutions ??

Hi,

I was looking 2 weeks ago for sending back and home key events when
onClick is performed on a ImageButton, I could do that perfectly.

Now, I have a device with no buttons. So, I want to simulate Menu
button click. To know what is really happening, I implemented a code
in onCreateOptionsMenu that rises a NullPointerException. I got the
following stack trace:

02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.parrot.mediaplayer.app.FidjiMediaPlayer.onCreateOptionsMenu(FidjiMediaPlayer.java:
146)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.app.Activity.onCreatePanelMenu(Activity.java:2038)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:
469)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:
745)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:
1413)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchKeyEvent(PhoneWindow.java:1862)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:
2188)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2158)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1490)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.os.Handler.dispatchMessage(Handler.java:99)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.os.Looper.loop(Looper.java:123)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
java.lang.reflect.Method.invokeNative(Native Method)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
java.lang.reflect.Method.invoke(Method.java:521)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
02-24 10:44:40.059: ERROR/AndroidRuntime(734):     at
dalvik.system.NativeStart.main(Native Method)



As we can see there is a call to ViewGroup and PhoneWindow. I guess
that we don't have access to these 2 classes in standard SDK. So is
there some native function to be invoked for example or any method in
that we can call from these on the given stack trace ?
Or can somebody provide us with an additional jar file that can make
our code compilable?
second possibility : Is there a way to do this with introspection API
(I don't know too much about this API).

third possible solution :
I found this code is View source :

View root = getRootView();
ViewRoot viewRoot = (ViewRoot)root.getParent();


so if we can just compile the code !!!

I think that this is very important because many developers are
looking for a such solution. And I really need to find a solution :(

Somebody can help please ?

-- 

3. New Android Project -> Create from existing source -> Unhandled event loop exception, java.lang.StackOverflowError

4. Modaco A9 apps2sd enabled

5. Yudith Kurniawan wants to share their location with you on Google Latitude

6. Tanya-tanya... :)

7. Share apk..... lagi?