Note that there are some explanatory texts on larger screens.

plurals
  1. POI want stop java.lang.security error
    text
    copied!<p>I am doing an Android application that has implemented a service. This service launch some key events. In my main activity I implemented this function :</p> <pre><code>@Override public boolean onKeyDown(int keyCode, KeyEvent evento) { if (keyCode == KeyEvent.KEYCODE_BACK) { stopService(new Intent(this, OpenCVService.class)); finish(); } return true; } return super.onKeyDown(keyCode, evento); } </code></pre> <p>to stop the service when the key is back, because if i don´t stop produce a security error.</p> <p>The problem is that in some devices and sometimes the error appears again and is this:</p> <pre><code>08-02 15:53:47.486: W/dalvikvm(14873): threadid=16: thread exiting with uncaught exception (group=0x40cad930) 08-02 15:53:47.486: E/AndroidRuntime(14873): FATAL EXCEPTION: Thread-373 08-02 15:53:47.486: E/AndroidRuntime(14873): java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.os.Parcel.readException(Parcel.java:1425) 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.os.Parcel.readException(Parcel.java:1379) 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.hardware.input.IInputManager$Stub$Proxy.injectInputEvent(IInputManager.java:356) 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.hardware.input.InputManager.injectInputEvent(InputManager.java:619) 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.app.Instrumentation.sendKeySync(Instrumentation.java:887) 08-02 15:53:47.486: E/AndroidRuntime(14873): at android.app.Instrumentation.sendKeyDownUpSync(Instrumentation.java:898) 08-02 15:53:47.486: E/AndroidRuntime(14873): at com.uvigo.gti.PictoDroidLite.Control3$1.run(Control3.java:268) </code></pre> <p>My question is "How can i do to control this error?"</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload