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 8908443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:10:46+00:00 2026-06-15T03:10:46+00:00

I am using different layouts to show different styled titles in my application. The

  • 0

I am using different layouts to show different styled titles in my application. The problem is that I can’t get a reference to a specific Textview that exists in all of them. If I change the text, nothing happens.

Here is what I am doing:

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

The following method does not work:

public void setTitle(String text) {
    TextView txtTitle = (TextView) this.findViewById(R.id.txtTitle);
    if(txtTitle !=null) {
        txtTitleMoney.setText(text);
        Log.d("debug", "not null");
    } 
}

I get no error so I think I’m accessing the wrong view.

Hopefully someone can help me 🙂

  • 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-06-15T03:10:47+00:00Added an answer on June 15, 2026 at 3:10 am

    if you set the same id (“txtTitle“) to the TextView items in all of your different title layouts, then your code should work.
    also make sure you call setTitle() after setContentView().

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

Sidebar

Related Questions

I've got a problem using different layouts for list items in my project. Here
I have a ViewController (with navigation) that needs to show 7 different content layouts
I want to have different layouts like [left|content|right] and [left|content] or [content|right] when using
I have a basic layout where different components can be selected using a tree
I created a drawing using different paths, but how can I move the entire
If i had two different application running under the same solution but using different
I have a thread that downloads some images from internet using different proxies. Sometimes
Currently, I'm using this to show my application background as phone wallpaper. getWindow().setFlags(WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
I've started working on a Java desktop application using netbeans. I have 7 different
I am currently using ViewFlipper for my main activity with two different layouts. I

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.