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%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- tarek -- 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

