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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:22:22+00:00 2026-05-23T09:22:22+00:00

I followed an online tutorial teaching how to build a custom title bar in

  • 0

I followed an online tutorial teaching how to build a custom title bar in android.
After you build the layout, here is how to add it onto an activity:

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

And if you add onClickListeners on the buttons which are part of the titlebar, you do this:

Button b1 = (Button) findViewById(R.id.b1);
        b1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MyApp.this, News.class);

                startActivity(intent);
            }
        });

This has to be done everytime you want to add a titlebar to an activity.

Is there a way to create a class for the titlebar and throw all in there so I dont have to repeat myself on each activity?

  • 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-23T09:22:23+00:00Added an answer on May 23, 2026 at 9:22 am

    What you most probably trying to do is an action bar. Please take a look at this question What is the equivalent of ActionBar in earlier sdk versions? to find out how to do it for an earlier sdk.

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

Sidebar

Related Questions

I followed a tutorial online on how to receive push notifications on Android. Got
Having followed a tutorial online, I have a sessions controller that looks like: class
I followed steps here: https://developers.facebook.com/docs/guides/mobile/#android but I really don't get how use Graph API
I have followed a few online tutorials and managed to install custom item templates
I have followed an example tutorial online for integrating in-app purchases in to my
I've followed online examples from here and Google with no success: meaning I have
I followed this tutorial on configuring the Rails plugin ExceptionNotifier. I know that I
I followed the Core Data tutorial at http://macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app The finished application displays data in
I followed the Tutorial in Cocoa Programming For Mac OS X to create a
I followed the RailsCasts tutorial to do a simple search with autocomplete, but it

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.