On Fri, Jul 22, 2011 at 4:35 AM, Animesh Sinha <animeshs...@gmail.com> wrote: > You are right in saying that android requires developers to write an > event-driven code and that effort needs to be put for designing the > whole chain of events. > > But for the following case as shown below, I don't think one can get > rid of the NullPointerException thrown in onClick() method of > MyServiceClient; Unless instead of storing Service Interface globally, > one stores it locally.
Developers disable UI widgets until they can be used. Hence, developers would have R.id.someBtn disabled until onServiceConnected() is called, at which point they would enable that widget and thereby allow the user to request actions that involve the service. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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