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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:32:14+00:00 2026-06-11T03:32:14+00:00

I am having a problem where my application is unexpectdly stopping. This is meant

  • 0

I am having a problem where my application is unexpectdly stopping. This is meant to be a simply application that let’s the user enter in the number of dice and a filter number. It is crashing unexpectedly, even though I cleaned it multiple times.
Here is the java file:

package com.greg.rostov.dice;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class DiceRoller extends Activity {
DiceRoller r=new DiceRoller();

@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button roll=(Button)findViewById(R.id.roll);

    roll.setOnClickListener(onRoll);
}
private View.OnClickListener onRoll=new View.OnClickListener() {
        public void onClick(View v){
            EditText numberofdice=(EditText)findViewById(R.id.roll);
            EditText filterdice=(EditText)findViewById(R.id.roll);
        }
    };




private String numberofdice="";
private String filterdice="";

public String getNumberofdice() {
    return(numberofdice);
}
public void setNumberofdice(String numberofdice){
    this.numberofdice=numberofdice;
}

public String getFilterdice() {
    return(filterdice);
}
public void setFilterdice(String filterdice){
    this.filterdice=filterdice;
}
}

And here is the error log:

    09-10 09:41:09.937: D/AndroidRuntime(551): Shutting down VM
    09-10 09:41:09.937: W/dalvikvm(551): threadid=1: thread exiting with uncaught exception(group=0x40015560)
    09-10 09:41:09.977: E/AndroidRuntime(551): FATAL EXCEPTION: main
    09-10 09:41:09.977: E/AndroidRuntime(551): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.greg.rostov.dice/com.greg.rostov.dice.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.TableLayout
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.os.Looper.loop(Looper.java:123)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread.main(ActivityThread.java:3683)
09-10 09:41:09.977: E/AndroidRuntime(551):  at java.lang.reflect.Method.invokeNative(Native Method)
09-10 09:41:09.977: E/AndroidRuntime(551):  at java.lang.reflect.Method.invoke(Method.java:507)
09-10 09:41:09.977: E/AndroidRuntime(551):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-10 09:41:09.977: E/AndroidRuntime(551):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-10 09:41:09.977: E/AndroidRuntime(551):  at dalvik.system.NativeStart.main(Native Method)
09-10 09:41:09.977: E/AndroidRuntime(551): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.TableLayout
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
09-10 09:41:09.977: E/AndroidRuntime(551):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-10 09:41:09.977: E/AndroidRuntime(551):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.Activity.setContentView(Activity.java:1657)
09-10 09:41:09.977: E/AndroidRuntime(551):  at com.greg.rostov.dice.MainActivity.onCreate(MainActivity.java:14)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
09-10 09:41:09.977: E/AndroidRuntime(551):  ... 11 more
09-10 09:41:09.977: E/AndroidRuntime(551): Caused by: java.lang.reflect.InvocationTargetException
09-10 09:41:09.977: E/AndroidRuntime(551):  at java.lang.reflect.Constructor.constructNative(Native Method)
09-10 09:41:09.977: E/AndroidRuntime(551):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
09-10 09:41:09.977: E/AndroidRuntime(551):  ... 21 more
09-10 09:41:09.977: E/AndroidRuntime(551): Caused by: android.content.res.Resources$NotFoundException: File #000000 from drawable resource ID #0x7f050004
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.content.res.Resources.loadDrawable(Resources.java:1714)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.View.<init>(View.java:1951)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.View.<init>(View.java:1899)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.view.ViewGroup.<init>(ViewGroup.java:286)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.widget.LinearLayout.<init>(LinearLayout.java:120)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.widget.TableLayout.<init>(TableLayout.java:105)
09-10 09:41:09.977: E/AndroidRuntime(551):  ... 24 more
09-10 09:41:09.977: E/AndroidRuntime(551): Caused by: java.io.FileNotFoundException: #000000
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.content.res.AssetManager.openNonAssetNative(Native Method)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
09-10 09:41:09.977: E/AndroidRuntime(551):  at android.content.res.Resources.loadDrawable(Resources.java:1706)
09-10 09:41:09.977: E/AndroidRuntime(551):  ... 30 more
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@string/backgroundcolor"
android:stretchColumns="1" 
>
<TableRow>
    <TextView 
     android:text="Dice:"
     android:textColor="@string/textcolor"
     android:textSize="25dp"/>

    <EditText
        android:id="@+id/dicebox"
        android:inputType="text" />
</TableRow>
<TableRow>
    <TextView 
    android:text="Filter"
    android:textColor="@string/textcolor"
    android:textSize="16dp"/>
    <EditText
    android:id="@+id/filterdicebox"/>
</TableRow>
<Button android:id="@+id/roll"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/textonbutton"
    android:textSize="25dp"
    />
</TableLayout>
  • 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-11T03:32:15+00:00Added an answer on June 11, 2026 at 3:32 am

    I suspect your problem is in your XML file, here:

    android:background="@string/backgroundcolor"
    

    What you’re doing here is passing in a string to a field which should take a color or drawable reference. As far as I know it doesn’t matter if the string in question is a valid color string (like #012). This won’t be treated like a preprocessor macro where the text is substituted in, rather it will look it up at runtime and get a value it doesn’t expect.

    To fix it, change the definition from

    <string name="backgroundcolor">#000000</string>
    

    to

    <color name="backgroundcolor">#000000</color>
    

    and refer to it in your layout file as

    android:background="@color/backgroundcolor"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem with structuring rails application. Let's say that I have
I'm having a problem with a cocoa application that takes the value of a
I'm having a problem with running an application I made on another computer. This
I have this problem having to display my jasper report on my grails application.
I'm having a problem with an ASP.NET MVC application that I'm developing. I'm still
I'm having a problem with an application that seems to cancel the shutdown or
I am having problem in using this font in my Application. I have imported
i am having a problem with my application,.i have this code in my mainviewcontroller
I have a user email me yesterday that he is having a problem with
In my application I am having problem to cover completely a page of the

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.