I would agree with you. I think the problem (or misunderstanding on my behalf) is that trying to call getWindowManager().addView outside of onCreate orphans the Window (getWindow() returns null). setContentView is just a shortcut for getWindow().setContentView() as you've mentioned. I'd post the code, but for the time being, it's not open to the public (or this forum at least). Your Android team has my code actually. Feel free to review it with them if interested. Thanks for the feedback. Appreciate it.
On Dec 4, 12:06 pm, Dianne Hackborn <[email protected]> wrote: > On Fri, Dec 4, 2009 at 11:44 AM, bizack <[email protected]> wrote: > > So the solution (or the problem) is don't use getWindowManager > > ().addView(view, params) if you want to capture key events. > > Your Window will be null. Your key events will go to Android Heaven. > > I'd think this was a bug or undesired behavior, but that's just > > personal opinion. > > I'm not sure where you get that. This is how all windows get added to the > window manager. Whether they get key events depends on a lot of things -- > their flags, their z-order, their window type, etc. > > You can use "adb shell dumpsys window" to see the current state of the > window manager, including which window has focus. > > -- > 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

