In my tablayout example, i have created 3 tabs, as usually i set 3 activities for each tab. I can set image to title bar of activity, which adds the intent to each tab. Due
The (standard) title you can change easily with
implementing onChildTitleChanged in the TabActivity
@Override
protected void onChildTitleChanged(Activity childActivity, CharSequence title) {
super.onChildTitleChanged(childActivity, title);
setTitle(title);
}
set the title in the child activities, f.e.
@Override
protected void onResume() {
setTitle("Calender");
super.onResume();
}
Changing a custom title shouldn't be that hard with this strategy. F.e. all your child-activities could implement a interface and have a method
public int getTitleResource()
The tab-activity can now do
@Override
protected void onChildTitleChanged(Activity childActivity, CharSequence title) {
super.onChildTitleChanged(childActivity, title);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, ((TabChild)childActivity).getTitleResource());
}
Or you can transport the id as part of the child-title-string and parse it back to int...