I have a header common in all activities.
header.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header_layout" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal">
<!-- home button -->
<ImageButton android:id="@+id/header_home_button"
android:src="@drawable/menu_info" android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<!-- header text -->
<TextView android:id="@+id/header_title" android:layout_width="200dip"
android:layout_height="wrap_content" android:gravity="center"
android:text="Todays recipe :" android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
However in different activities the title changes for textview and image for imageButton also changes. How to change them at runtime?
Thanks
you just need to get the both the Button and TextView by their id and set the image and text from your activity.