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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:08:57+00:00 2026-06-01T15:08:57+00:00

LOGCAT 04-03 20:59:46.189: E/AndroidRuntime(362): android.content.res.Resources$NotFoundException: String resource ID #0x0 04-03 20:59:46.189: E/AndroidRuntime(362): at android.content.res.Resources.getText(Resources.java:201)

  • 0

LOGCAT

04-03 20:59:46.189: E/AndroidRuntime(362): android.content.res.Resources$NotFoundException: String resource ID #0x0 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.content.res.Resources.getText(Resources.java:201) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.widget.TextView.setText(TextView.java:2857) 
04-03 20:59:46.189: E/AndroidRuntime(362): at coin.calc.wilson.CoinCalculatorActivity$1.onClick(CoinCalculatorActivity.java:65) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.view.View.performClick(View.java:2485) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.view.View$PerformClick.run(View.java:9080) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.os.Handler.handleCallback(Handler.java:587) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.os.Handler.dispatchMessage(Handler.java:92) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.os.Looper.loop(Looper.java:123) 
04-03 20:59:46.189: E/AndroidRuntime(362): at android.app.ActivityThread.main(ActivityThread.java:3683) 
04-03 20:59:46.189: E/AndroidRuntime(362): at java.lang.reflect.Method.invokeNative(Native Method) 
04-03 20:59:46.189: E/AndroidRuntime(362): at java.lang.reflect.Method.invoke(Method.java:507) 
04-03 20:59:46.189: E/AndroidRuntime(362): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
04-03 20:59:46.189: E/AndroidRuntime(362): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
04-03 20:59:46.189: E/AndroidRuntime(362): at dalvik.system.NativeStart.main(Native Method) 
04-03 20:59:49.720: I/Process(362): Sending signal. PID: 362 SIG: 9

Here is my java code:

package coin.calc.wilson;

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

public class CoinCalculatorActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button solve = (Button)findViewById(R.id.bsolve);
    solve.setOnClickListener(new OnClickListener() {

        public void onClick(View v) { 
    int td, tc, twenty, ten, five, one, quarter, dime, nickel, penny;
    EditText tdet = (EditText)findViewById(R.id.etdollars);
    EditText tcet = (EditText)findViewById(R.id.etcents);
        try{
            td = Integer.parseInt(tdet.getText().toString());
            tc = Integer.parseInt(tdet.getText().toString());
        }
        catch (NumberFormatException e) {
            td = tc = 0;
        }

    if (td < 0 || tc < 0){
        /* ERROR */
    }
    else{
        if( td == 0 ){
            twenty = ten = five = one = 0;
        }
        else{
            one = td%5;

            if(td >= 20){
                twenty = (td/20)-((td%20)/20);
            }
            else{
                twenty = 0;
            }

            int tda20 = td-(20*twenty);
            if (tda20 >= 10){
                ten = (tda20/10)-((tda20%10)/10);
            }
            else{
                ten = 0;
            }
            int tda10 = tda20-(10*ten);
            if(tda10>=5){
                five = (tda10/5)-((tda10%5)/5);
            }
            else{
                five = 0;
            }
            TextView tv20 = (TextView)findViewById(R.id.tvtwenty);
            tv20.setText(twenty);
            TextView tv10 = (TextView)findViewById(R.id.tvten);
            tv10.setText(ten);
            TextView tv5 = (TextView)findViewById(R.id.tvfive);
            tv5.setText(five);
            TextView tv1 = (TextView)findViewById(R.id.tvone);
            tv1.setText(one);

            }


        if( tc == 0 ){
            quarter = dime = nickel = penny = 0;
        }
        else{
            penny = tc%5;

            if(tc >= 25){
                quarter = (tc/25)-((td%25)/25);
            }
            else{
                quarter = 0;
            }

            int tcaq = tc-(25*quarter);
            if (tcaq >= 10){
                dime = (tcaq/10)-((tcaq%10)/10);
            }
            else{
                dime = 0;
            }
            int tcad = tcaq-(10*ten);
            if(tcad>=5){
                nickel = (tcad/5)-((tcad%5)/5);
            }
            else{
                nickel = 0;
            }
            TextView tvq = (TextView)findViewById(R.id.tvquarter);
            tvq.setText(quarter);
            TextView tvd = (TextView)findViewById(R.id.tvdime);
            tvd.setText(dime);
            TextView tvn = (TextView)findViewById(R.id.tvnickel);
            tvn.setText(nickel);
            TextView tvp = (TextView)findViewById(R.id.tvpenny);
            tvp.setText(penny);

            }
}
}});}
}

and here is the xml:

<TableRow
    android:id="@+id/tableRow1"
    android:layout_height="wrap_content"
    android:gravity="center" >

    <EditText
        android:id="@+id/etdollars"
        android:layout_width="156dp"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="number" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="dollars"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</TableRow>

<TableRow
    android:id="@+id/tableRow2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center" >

    <EditText
        android:id="@+id/etcents"
        android:layout_width="156dp"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="number" />
     <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="cents"
        android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="60dp"
    android:gravity="center" >

    <Button
        android:id="@+id/bsolve"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Solve!" />

</LinearLayout>


<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="80dp" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:layout_weight="0.00"
        android:layout_marginLeft="8.75dp"
        android:layout_marginRight="8.75dp"
        android:src="@drawable/twenty" />

    <TextView
        android:id="@+id/tvtwenty"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="61dp"
        android:layout_height="80dp"
        android:layout_marginLeft="43dp"
        android:layout_marginRight="13.5dp"
        android:src="@drawable/cquarter" />
    <TextView
        android:id="@+id/tvquarter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="80dp" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:layout_weight="0.00"
        android:layout_marginLeft="8.75dp"
        android:layout_marginRight="8.75dp"
        android:src="@drawable/ten" />

    <TextView
        android:id="@+id/tvten"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="61dp"
        android:layout_height="80dp"
        android:layout_marginLeft="43dp"
        android:layout_marginRight="13.5dp"
        android:src="@drawable/cdime" />
    <TextView
        android:id="@+id/tvdime"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="80dp" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:layout_weight="0.00"
        android:layout_marginLeft="8.75dp"
        android:layout_marginRight="8.75dp"
        android:src="@drawable/five" />

    <TextView
        android:id="@+id/tvfive"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="61dp"
        android:layout_height="80dp"
        android:layout_marginLeft="43dp"
        android:layout_marginRight="13.5dp"
        android:src="@drawable/cnickel" />
    <TextView
        android:id="@+id/tvnickel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="80dp" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:layout_weight="0.00"
        android:layout_marginLeft="8.75dp"
        android:layout_marginRight="8.75dp"
        android:src="@drawable/one" />

    <TextView
        android:id="@+id/tvone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="61dp"
        android:layout_height="80dp"
        android:layout_marginLeft="43dp"
        android:layout_marginRight="13.5dp"
        android:src="@drawable/cpenny" />
    <TextView
        android:id="@+id/tvpenny"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:layout_gravity="center_vertical"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>

</TableLayout>

If it helps, i think the error MAY have something to do with resources i am using (eight jpgs), but i’m not sure. The program runs cleanly up until the OnClickListener is activated. Thanks for any and all help!

  • 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-01T15:08:58+00:00Added an answer on June 1, 2026 at 3:08 pm

    Is here (and in another lines like that):

    tv20.setText(twenty);
    

    twenty is int and should be String (I suppose that you want to show the number in the textview):

    tv20.setText(String.valueOf(twenty));
    

    EDIT:

    All this variables have the same error

    int td, tc, twenty, ten, five, one, quarter, dime, nickel, penny;

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

Sidebar

Related Questions

In Android Emulator i am getting below Logcat Error: 03-11 04:44:56.663: ERROR/AndroidRuntime(403): java.lang.RuntimeException: Unable
Logcat 08-17 06:37:22.264: ERROR/AndroidRuntime(1090): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.NullPointerException 08-17 06:37:22.264: ERROR/AndroidRuntime(1090):
Update 2 Logcat: 03-02 19:03:47.616: E/AndroidRuntime(881): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{TheTask}: java.lang.InstantiationException: .TheTask
The logcat error: 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): FATAL EXCEPTION: main 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): java.lang.RuntimeException: Unable
Here is my LogCat log: 08-25 22:35:27.989: ERROR/AndroidRuntime(327): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested,
When I execute the command adb logcat while running the android emulator, all of
Can someone please explain how to understand a logcat from an android force close.
When i was working on my Android project i found Logcat to be annoying
I am new in android and i print log-cat using: Log.w(Tag, String text); and
My Logcat 08-06 01:27:34.874: ERROR/AndroidRuntime(721): Uncaught handler: thread main exiting due to uncaught exception

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.