Hi,
I am looking into Android frameworks/base/services/java/com/android/
server/WindowManagerService.java. I want to dispatch back key from my
activity to the top activity which is currently running, In
WindowManagerService.java i added the following code

 private Handler msgHandler = new Handler(){
     //this method will handle the calls from other threads.
    public void handleMessage(Message msg) {
        int result = -1;
        switch (msg.what) {
            case TPMUHelper.DISPATCH_BACK_KEY:
                Log.d(TAG, "Dispatching Back_Key");
                code = KeyEvent.KEYCODE_BACK;
                KeyEvent backEvent = new KeyEvent(downTime, eventTime,
action, code, repeatCount, metaState,
                deviceId, scancode, KeyEvent.FLAG_FROM_SYSTEM);
                Log.i(TAG, "PID = " + mpid + ", UID = " +muid);
                result = dispatchKey(backEvent, mpid, muid);
                Log.d(TAG, "Dispatch Key Returns = " + result);
            break;
      }
  }
};

When i send message from my-activity, it comes here and dispatch back
key, dispatch key returns '1', i am success with this, however
currently running activity is not getting closed. please help me.
simply what i need is, i want to send back key to whichever the
activity is currently running, (system application or 3rd party
application).

Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to