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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:19:08+00:00 2026-06-12T08:19:08+00:00

I want to create a layout for my android application using inheritance i.e. every

  • 0

I want to create a layout for my android application using inheritance i.e. every screen will have the same background and header.

The layout with that background and header is specified like this:

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="25dp"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/headerLabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="2dp"
        android:text="@string/app_name"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="@string/ColorLabel" />

</LinearLayout>

</merge>

While a specific screen, the login screen, looks like this:

    <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <include
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        layout="@layout/background" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="50dp"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/username_label"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:text="@string/Username"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/username_box"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:ems="10"
            android:inputType="text" >

            <requestFocus />
        </EditText>

        <TextView
            android:id="@+id/password_label"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="10dp"
            android:layout_weight="1"
            android:text="@string/Password"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <EditText
            android:id="@+id/password_box"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:ems="10"
            android:inputType="textPassword" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_gravity="fill"
            android:layout_marginTop="10dp"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:weightSum="2" >

            <Button
                android:id="@+id/login_button"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center|left"
                android:layout_marginRight="20dp"
                android:background="@drawable/background"
                android:text="@string/Login"
                android:textColor="@string/ColorLabel" />

            <Button
                android:id="@+id/register_button"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@drawable/background"
                android:text="@string/Register"
                android:textColor="@string/ColorLabel" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

</merge>

When I want to run this code, it causes an error:

10-05 17:10:11.620: D/AndroidRuntime(25222): Shutting down VM
10-05 17:10:11.623: W/dalvikvm(25222): threadid=1: thread exiting with uncaught exception (group=0x40015578)
10-05 17:10:11.635: E/AndroidRuntime(25222): FATAL EXCEPTION: main
10-05 17:10:11.635: E/AndroidRuntime(25222): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shopassistent/com.shopassistent.Login_Activity}: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.os.Looper.loop(Looper.java:123)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread.main(ActivityThread.java:3687)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at java.lang.reflect.Method.invokeNative(Native Method)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at java.lang.reflect.Method.invoke(Method.java:507)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at dalvik.system.NativeStart.main(Native Method)
10-05 17:10:11.635: E/AndroidRuntime(25222): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.createView(LayoutInflater.java:518)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:682)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.Activity.setContentView(Activity.java:1657)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at com.shopassistent.Login_Activity.onCreate(Login_Activity.java:12)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
10-05 17:10:11.635: E/AndroidRuntime(25222):    ... 11 more
10-05 17:10:11.635: E/AndroidRuntime(25222): Caused by: java.lang.reflect.InvocationTargetException
10-05 17:10:11.635: E/AndroidRuntime(25222):    at java.lang.reflect.Constructor.constructNative(Native Method)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
10-05 17:10:11.635: E/AndroidRuntime(25222):    ... 26 more
10-05 17:10:11.635: E/AndroidRuntime(25222): Caused by: android.content.res.Resources$NotFoundException: File #ffffff from drawable resource ID #0x7f040009: .xml extension required
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.content.res.Resources.loadColorStateList(Resources.java:1824)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.widget.TextView.<init>(TextView.java:677)
10-05 17:10:11.635: E/AndroidRuntime(25222):    at android.widget.TextView.<init>(TextView.java:369)
10-05 17:10:11.635: E/AndroidRuntime(25222):    ... 29 more

Can anybody see where this error comes from?

  • 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-12T08:19:09+00:00Added an answer on June 12, 2026 at 8:19 am

    Here

    android:textColor="@string/ColorLabel"
    

    It returns a #FFFFFF as a string, which in turn is interpreted as a drawable filename, hence

    Caused by: android.content.res.Resources$NotFoundException: File #ffffff from drawable resource ID #0x7f040009: .xml extension required
    

    use a drawable or a color reference for a textColor

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

Sidebar

Related Questions

I want to create a layout for an Android app that has a numeric
I want to create a multicolumn layout in html that will run from left
I am creating an application that will have multiple images on the screen, these
I am new in developing android applications. I want to create an android application(using
I want to create a splash screen that will then move to the login/register
I want to create a layout that has 6 TextViews on the very top,
I want to create a layout in such a way that on top edittext
I'm trying to create a scrollable layout in Android. Even using developers.android.com, though, I
I want to write application where I create layout in the code (without xml-layout
I want to create an Application with tabs, and I have found this guide

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.