Break the title bar into a separate layout and use the include xml tag. I do this in several of my applications. Each of your actions can be inherited from the Base action, which contains events for the included layout, for example, if there are buttons in the title bar.
An example of pseudocode below.
title.xml
<LinearLayout> <TextView text="Some text"/><Button text="Some Button" onCLick="buttonClick"/> </LinearLayout>
activity layouts for each layout
<RelativeLayout> <include layout="@layout/title" /> </RelativeLayout>
Baseactivity
public class BaseActivity extends Activity { public void buttonClick(View v) {
source share