Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:26:14+00:00 2026-05-30T22:26:14+00:00

Ok i will try to be as detailed as i can here. I have

  • 0

Ok i will try to be as detailed as i can here. I have an app with multiple activities in it. Some of the activities I want to have a custom title bar on with an Image, then text, then image button navigating back to the home(aka main activity). Most of the pages i want the custom title bar on are list view pages. I have successively been able to load the custom title bar but it doesn’t load any text field or images just the title bar with nothing in it. here is the code that i’ve used.

window_title.xml

    <?xml version="1.0" encoding="utf-8"?>
   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:gravity="center_vertical"
android:paddingLeft="5dip"
android:background="#660000">

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/icon72" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="0.39"
    android:gravity="right|center_vertical"
    android:paddingRight="5dip" >

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="16sp"
        android:text="@string/app_name"
        android:textColor="#FFFFFF"
        android:paddingRight="5dip" />

    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#660000"
        android:src="@drawable/home" />

    <ImageView
        android:id="@+id/home"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>

</LinearLayout>

custom_style.xml

     <resources>
<style name="CustomWindowTitleBackground">
    <item name="android:background">#660000</item>
</style>

<style name="CustomTheme" parent="android:Theme">
    <item name="android:windowTitleSize">50dip</item>
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>

Classes.Java

 import android.app.ListActivity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 import android.view.Window;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;

 public class Classes extends ListActivity  {

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);

        setListAdapter( new ArrayAdapter<String>(this, R.layout.ministries, list));

        ListView list = getListView();
        list.setTextFilterEnabled(true);
        list.setOnItemClickListener(new OnItemClickListener(){

I’m not sure what i’m doing wrong or where i need to make changes but I would like to be able to have this custom title bar on some of the activities and load the name of that activity in the title bar. I’ve looked at several tutorials and these two have helped but i’m kinda stuck a bit. http://staticallytyped.wordpress.com/2011/03/18/android-dynamic-and-custom-title-bars/
and this one has helped the most and what i basicly followed
http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/

Thank you for any help you can give. I would have posted pics but haven’t gotten that far on here yet so thank you again for any help

edit
This is what i want it to look like
this is what it looks like now in app

the top image is what i want the title bar to look like and the bottom is what it looks like in app

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:26:15+00:00Added an answer on May 30, 2026 at 10:26 pm

    YOu can use include tag of android to add your window_title.xml….

    Refer :
    android include tag – invalid layout reference
    http://developer.android.com/resources/articles/layout-tricks-merge.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First I will try to explain what I want to do. The app loads
I have a little Try Catch block that will tell the user more detailed
I will try to explain this the best that I can. I have a
I will try to be brief/detailed about what i am trying to do here.
I will try to explain it simple: I have an entity - Image -
I will try and word this question the best I can, for it is
I will try to make this as clear as I can, but if you
I will try to be as clear as possible because I can't get anybody
I will try to keep this as simple as possible. I have a rather
I will try to explain a simple app scenario: My app goes right to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.