Is there a mechanism in place to basically force key events to a specific Activity?
I think the problem is this Activity (it's actually at the platform level, but the question is relevant here) is modal, but not necessarily in focus. This is by design. If the Application launched the Activity, who/what is receiving the key presses in this scenario? On Dec 2, 6:11 pm, Dianne Hackborn <[email protected]> wrote: > You can't forward events from one window to another. > > > > > > On Wed, Dec 2, 2009 at 6:09 PM, bizack <[email protected]> wrote: > > Actually, I should clarify. > > > I have an Activity, A. > > There's an Application, B, that is launched at any given point in > > time. > > Application B launches Activity C (on top of Activity A, but Activity > > C is flagged with FLAG_NOT_TOUCH_MODAL). > > The Application B is never visible, never in focus (and obviously has > > no onKeyUp or onKeyDown methods). > > I'm returning key events from Activity C via super.onKeyUp and > > super.onKeyDown. > > However, my Activity C is never receiving any key events (and > > apparently Activity A no longer receives key events when Application B > > is launched). > > > I'm assuming the key events are getting thrown up into the system and > > landing... somewhere. > > > So... how do I forward key events to Activity C from Activity A while > > an Application B is running? I hope this isn't too confusing... but > > I'm assuming someone's run into this problem before. > > > Thanks. > > > On Dec 2, 4:44 pm, bizack <[email protected]> wrote: > > > I have an Activity which has no window (but it has a view). > > > > I'm using: > > > getWindowManager().addView(view, params); > > > > I've attempted to call takeKeyEvents(true), however I see that > > > takeKeyEvents first retrieves the Window and then calls takeKeyEvents > > > on that Window. In my case, the Window is null. > > > > What this means is that I never receive onKeyUp and onKeyDown calls, > > > which I need in order to intercept some key presses from external > > > input devices (similar to a handsfree set for example). > > > > Any hints as to how I would accomplish this? > > > > Thanks. > > > -- > > 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]<android-developers%2Bunsubs > > [email protected]> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- 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

