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 <tarek.m.at...@gmail.com>wrote: > > Thanks you so much Mark. > > On Sun, Nov 21, 2010 at 12:30 AM, Mark Murphy <mmur...@commonsware.com>wrote: > >> On Sat, Nov 20, 2010 at 5:17 PM, tarek attia <tarek.m.at...@gmail.com> >> wrote: >> > Thanks for such a response >> > >> > On Sun, Nov 21, 2010 at 12:09 AM, Mark Murphy <mmur...@commonsware.com> >> > 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 android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > tarek > -- tarek -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en