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

  • Home
  • SEARCH
  • 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 6697375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:27:09+00:00 2026-05-26T06:27:09+00:00

I have a custom title bar set on my TabActivity. The custom title bar

  • 0

I have a custom title bar set on my TabActivity. The custom title bar contains a TextView and an ImageView in it. The tabHost has multiple tabs.

What I want to do is to access the ImageView resource in the tabs.

I am accessing the TextView from custom title bar in the main Tab activity (that extends TabActivity) and it is working fine. Following is the code which is working fine in main activity:

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.myactivity);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mycustomtitle);
TextView tv = (TextView) findViewById(R.id.viewTitleId);

Now I want to access the ImageView in my tabs (which are added in tabHost). If I set following code in tab:

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

It gives following error:

You cannot combine custom titles with other title features

And if i directly set following in the tab code:

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mycustomtitle);
ImageView image = (ImageView) findViewById(R.id.imageTitleId);

The image remains null.

mycustomtitle.xml has following two elements:

<TextView 
     android:layout_width="0dp"
     android:layout_height="wrap_content" 
     android:layout_weight="0.80"
     android:id="@+id/viewTitleId"
     android:textColor="@color/titleBarTextColor"
     android:gravity="center_vertical"
     android:text="@string/viewText"
     android:textSize="18px"
     android:paddingLeft="45px"
     />

<ImageView 
    android:layout_height="wrap_content" 
    android:layout_width="0dp" 
            android:layout_weight="0.20"
    android:src="@drawable/btn_save" 
    android:id="@+id/imageTitleId"
    >
</ImageView>

Please give me some idea how can I access the Custom title’s ImageView in the tabs ?

  • 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-26T06:27:10+00:00Added an answer on May 26, 2026 at 6:27 am

    You can access the TextView and ImageView by declaring them public static in the TabActivity. Then, in the Sub-Activity you obviously access the public static TextView and ImageView like,

    Main_Tab_Activity.textView.setText("my_text_view");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom Title Bar so I want that when the user types
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have a custom title bar requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.activities); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); Which works basically fine.
I want to show in my custom title bar on which Page i am
I have an application which uses a custom title bar. However, when my application
I want to customize the title bar for an Android application. I have the
I have implemented custom title bar feature using the following class CustomWindow . Other
I have a problem about the title bar. I want to do 2 buttons
I have the same problem like this question: Custom title bar in PreferenceActivity? After
I have a form that I would like to draw a custom title bar

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.