Same Title Bar but different View below it in Android?

Posted by sunil on Stack Overflow See other posts from Stack Overflow or by sunil
Published on 2010-04-09T14:43:55Z Indexed on 2010/04/09 16:03 UTC
Read the original article Hit count: 274

Filed under:
|
|
|

Hi,

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.

Can we use ViewGroup for that? I don't have much idea about ViewGroup. Is that possible with ViewGroup?

If anyone knows the solution then please let me know.

Thanks & Regards Sunil

© Stack Overflow or respective owner

Related posts about android

Related posts about button