You get that warning for no obvious reason all the time. I've learnt to live with it.
That said, requestFocus() seems to have a race condition. I cannot pinpoint exactly, but on a bunch of my activities I have to do requestFocus() from a Handler, otherwise the focus is not set properly. In other places, requestFocus() works. It just seems fragile. On Nov 21, 7:00 am, tarek attia <[email protected]> wrote: > However it's now working fine,however the logcat shows some of the previous > warnings :- > > WARN/InputManagerService(76): *Window already focused, ignoring focus gain > of: com.android.internal.view.iinputmethodclient$stub$pr...@43304038* > * > * > ***WARN/InputManagerService(76): Starting input on non-focused client > com.android.internal.view.iinputmethodclient$stub$pr...@4324fad0 (uid=10010 > pid=124) > * > On Sun, Nov 21, 2010 at 12:53 AM, tarek attia <[email protected]>wrote: > > > > > > > > > Thanks you so much Mark. > > > On Sun, Nov 21, 2010 at 12:30 AM, Mark Murphy > > <[email protected]>wrote: > > >> On Sat, Nov 20, 2010 at 5:17 PM, tarek attia <[email protected]> > >> wrote: > >> > Thanks for such a response > > >> > On Sun, Nov 21, 2010 at 12:09 AM, Mark Murphy <[email protected]> > >> > wrote: > > >> >> You are trying to call a method on a null object on line 232 of > >> >> AnaFain.java. > > >> > in this line of code I call guiHandler.post(noConnectionAlert); > > >> Hence, guiHandler is null. > > >> > noConnectionAlert is a runnable i declared above in the code,,,and if > >> that > >> > why it sometimes working fine and sometimes not ?? > > >> I have no idea. Your activity apparently has hundreds of lines of > >> code. You have supplied us with one. The burden of debugging is on > >> you, not us. > > >> Yes I know this ,but just I was thinking out loud. > > >> You need to determine: > > >> * -- where you are initializing guiHandler* > > > The problem was here,,as I was initializing it after I start the thread ,so > > when I reversed the order it worked fine (declared the handler before > > starting the thread),and it works fine now in all case . > > >> -- where line 232 is > >> -- under what circumstances would line 232 be executed before the line > >> where you are initializing guiHandler > > >> -- > >> Mark Murphy (a Commons Guy) > >>http://commonsware.com|http://github.com/commonsguy > >>http://commonsware.com/blog|http://twitter.com/commonsguy > > >> _The Busy Coder's Guide to Android Development_ Version 3.2 Available! > > >> -- > >> 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 > > > -- > > tarek > > -- > tarek- Hide quoted text - > > - Show quoted text - -- 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

