javame_android wrote: > In one of my Android Application I need to keep the title bar same but > the view that is shown in the rest of the screen changes. So, I have > taken different Activity for all the views that I need to show and set > the title bar in every Activities onCreate method. > > Now, the problem is that I have a button in the title bar and need to > perform certain action on its click event. Writing the same event > handling code in every Activity class is very cumbersome. Is there any > other way out that whenever there is a click event on that button of > the title bar then we can have the same functionality without writing > the same code in all the Activity classes.
Step #1: Create a subclass of Activity that includes your button logic Step #2: Have your other activities subclass the class you created in step #1 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.4 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.

