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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:48:42+00:00 2026-06-07T05:48:42+00:00

I am creating Relative Layout which looks fine not giving any error at that

  • 0

I am creating Relative Layout which looks fine not giving any error at that time.but when i am trying to run this application I am getting the error at runtime as mentioned below.

The erroe is:

   07-03 23:04:55.420: D/AndroidRuntime(20456): Shutting down VM
    07-03 23:04:55.430: W/dalvikvm(20456): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
    07-03 23:04:55.491: E/AndroidRuntime(20456): FATAL EXCEPTION: main
    07-03 23:04:55.491: E/AndroidRuntime(20456): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.customdialog/com.customdialog.CustomDialogExample}: android.view.InflateException: Binary XML file line #3: Error inflating class android.widget.RelativeLayout
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.os.Handler.dispatchMessage(Handler.java:99)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.os.Looper.loop(Looper.java:123)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread.main(ActivityThread.java:4627)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at java.lang.reflect.Method.invokeNative(Native Method)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at java.lang.reflect.Method.invoke(Method.java:521)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at dalvik.system.NativeStart.main(Native Method)
    07-03 23:04:55.491: E/AndroidRuntime(20456): Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class android.widget.RelativeLayout
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.createView(LayoutInflater.java:513)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.Dialog.setContentView(Dialog.java:421)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.customdialog.CustomizeDialog.<init>(CustomizeDialog.java:24)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at com.customdialog.CustomDialogExample.onCreate(CustomDialogExample.java:16)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    ... 11 more
    07-03 23:04:55.491: E/AndroidRuntime(20456): Caused by: java.lang.reflect.InvocationTargetException
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.widget.RelativeLayout.<init>(RelativeLayout.java:170)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at java.lang.reflect.Constructor.constructNative(Native Method)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.LayoutInflater.createView(LayoutInflater.java:500)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    ... 22 more
    07-03 23:04:55.491: E/AndroidRuntime(20456): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f06000b a=-1 r=0x7f06000b}
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.content.res.Resources.loadDrawable(Resources.java:1681)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.View.<init>(View.java:1885)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.View.<init>(View.java:1834)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    at android.view.ViewGroup.<init>(ViewGroup.java:285)
    07-03 23:04:55.491: E/AndroidRuntime(20456):    ... 26 more

Here is my CustomDialogExample class.

 public class CustomDialogExample extends Activity {
    /** Called when the activity is first created. */
        CustomizeDialog customizeDialog;
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    /** Display Custom Dialog */
    customizeDialog = new CustomizeDialog(CustomDialogExample.this);
    Log.i("Log", "show method called");
    customizeDialog.show();

    }
    }

And Here is the CustomizeDialog.class by which the dialog box is created..

public class CustomizeDialog extends Dialog{

    Button dialogButtonYes;
    Button dialogButtonNo;
    TextView textView,titleText,customtitle;
    public CustomizeDialog(Context context){
        super(context);

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        /** Design the dialog in main.xml file */
        setContentView(R.layout.relative);
        dialogButtonYes = (Button) findViewById(R.id.buttonCustomDialogYes);
        dialogButtonNo = (Button) findViewById(R.id.buttonCustomDialogNo);
        textView = (TextView) findViewById(R.id.textViewCustomTitle);
        //customtitle.setText(title);
        textView.setText("ffg");
}
}

And the relative.xml layout xml file is:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@style/HeadingTheme"
    android:layout_centerHorizontal="true" >
    <TextView
        android:id="@+id/textViewCustomTitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="ABCD"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textViewCustomTitle"
        android:orientation="horizontal"
        android:paddingBottom="1.0dip"
        android:paddingLeft="4.0dip"
        android:paddingRight="4.0dip"
        android:paddingTop="5.0dip" >
        <Button
            android:id="@+id/buttonCustomDialogYes"
            android:layout_width="0.0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:text="Yes" />
        <Button
        android:id="@+id/buttonCustomDialogNo"
           android:layout_width="0.0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:text="No" />
    </LinearLayout>
</RelativeLayout>

Please let me know if anybody is facing this problem and the solution also they tried to resolve this problem

Thanks in advance..

  • 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-07T05:48:43+00:00Added an answer on June 7, 2026 at 5:48 am

    I think it’s complaining about your background (android:background).

    Resource is not a drawable.
    

    Try to remove that attribute from your RelativeLayout just to make sure that’s the problem. If so, check what’s going on with the given resource.

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

Sidebar

Related Questions

Creating a simple RPG game, first time using XNA. Trying to get my character
I have been having problems creating a relative layout in XML for a list
The code is below but I am having some issues with creating a relative
I'm creating an scrollable image picker, but there's some info that I want to
I am creating a page where I do not want any fixed px height
I need to create the layout like this but not getting perfect. getting this
I am using this which is successful in creating a counter for letters relative
I'm trying to write a simple timer app. I'm creating a counter class that
I'm having a problem creating a layout that's partly liquid. The layout has to
Creating liquid layouts is an immense pain. Now, I totally understand that tables should

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.