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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:09:37+00:00 2026-06-08T07:09:37+00:00

I want that this code: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android > <TextView android:id=@+id/logo style=@style/logo android:layout_alignParentTop=true android:text=@string/logo tools:context=.MainActivity

  • 0

I want that this code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" >

<TextView android:id="@+id/logo" style="@style/logo"
    android:layout_alignParentTop="true"
    android:text="@string/logo" tools:context=".MainActivity" />

to start in every layout. How can I do that I wouldn’t need to add this to every layout page? Like for example in PHP I would use <?=include("header.php");?> (just an example, actually it’s bad practise, doesn’t matter here). Thank you.

  • 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-08T07:09:39+00:00Added an answer on June 8, 2026 at 7:09 am

    Save your header in XML file and then include this XML as child layout in other layouts:

    <include  layout="@layout/headerlayout" android:id="@+id/headerLayoutid"  ...  />
    

    The headerlayout.xml is name of your above layout that should be defined in res/layout and you like that be shown as header in all layouts(layout="@layout/headerlayout"),also headerLayoutid is id of your headerlayout(in it’s parent) and you can reference to it in your parent layouts or in your code.
    You can override all the layout parameters. This means that any android:layout_* attribute can be used with the tag. Here is an example:

    <include android:layout_width="fill_parent" layout="@layout/image_holder" />  
    

    You can see more details in about include in this page.
    Edit:
    If you have problems in about finding views in included layout,see this questions,I hope these help you:
    findViewById not working for an include?
    Finding an view by id?

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

Sidebar

Related Questions

I have this code that I want to make point-free; (\k t -> chr
This code isn't localized: Enum.GetNames(typeof(DayOfWeek)) I want a method that returns a list of
I have this html code that i want to edit with jQuery. Here is
This code didn't works as expected. I want to select all the posts that
found this little code snippet that seems to do what i want, but im
I have something like this in my code: worker.setObject(queue.poll()); I want a queue that
this is my code that I write it but I want to use LINQ
I have code that I want to look like this: List<Type> Os; ... foreach
I want this for some conditional compilation code that will run in all IE's
I want to write a line of code that returns a pointer to this

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.