I\'m working on an Android application and I\'d like to maintain a top-bar of sorts in most of my Activities, as per the Twitter and Facebook applications. How is this done? I\'
Break the title bar out into a separate layout, and use the include xml tag. I do that in a few of my apps. Each of your activities can inherit from a Base Activity that contains events for the included layout, e.g. if the title bar has buttons.
Example pseudocode below.
title.xml
activity layouts for each layout
BaseActivity
public class BaseActivity extends Activity {
public void buttonClick(View v) {
// do something interesting.
}
}
public class OtherActivity extends BaseActivity {}