I override the Activity class as follows:
public class MyCustomActivity extends Activity { ... ... } public class MyActivity extends MyCustomActivity { ... ... }
And the declaration of activity in the manifest is as follows:
<activity android:name=".MyCustomActivity" android:label="@string/app_name" > </activity> <activity android:name=".MyActivity" android:label = "ChildActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
My problem is that the action title defined in the manifest in android:label="ChildActivity" does not display with a custom style. How can I do this without calling setTitle(charSeq); in every action?
Edit:
One thing (terrible thing) that I forgot about is that I use a custom style as follows;
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/CustomTheme" > ... ... </application>
Edit (after @Mudassir's answer): I am using a custom title bar as shown below:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dip" android:gravity="center_vertical" android:orientation="horizontal" > <LinearLayout android:layout_width="wrap_content" android:gravity="left" android:orientation="horizontal" > <ImageView android:id="@+id/imageViewIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/vector_arts" android:layout_marginLeft="-15dp" /> <TextView android:id="@+id/textTitleBar" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </RelativeLayout>
source share