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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:02:15+00:00 2026-05-26T01:02:15+00:00

The problem is a Resources$NotFoundException in the tv2.settext(), i don’t know why i have

  • 0

The problem is a Resources$NotFoundException in the tv2.settext(), i don’t know why i have a TreeMap, inside the pizza title and the count.
Please help!

Calling:

for (Pizza pizza : list) {

            if(map.containsKey(pizza.title))
            {

                int i = map.get(pizza.title);
                map.remove(pizza.title);

                map.put(pizza.title, i++);
            }
            else
            {
                map.put(pizza.title, 1);
            }
          }

Pizza:

public class Pizza implements Comparable<String> {

    public String title;
    public int rate;
    public String date;
    public Bitmap picture;
    public int id;
    @Override
    public int compareTo(String another) {
        // TODO Auto-generated method stub
        return this.title.compareTo(another);
    }

}

Error Code:

for (Entry<String, Integer> entry : map.entrySet()) {

            tv.setText(entry.getKey());
            tv2.setText((Integer)entry.getValue()); //Error occures here

            tv.setGravity(Gravity.LEFT);
            tv2.setGravity(Gravity.RIGHT);

            TableRow tr1 = new TableRow(this);
            tr1.addView(tv);
            tr1.addView(tv2);
            tl.addView(tr1, new TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
            }
        }

Error:

10-04 09:04:40.475: ERROR/AndroidRuntime(954): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
  • 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-05-26T01:02:16+00:00Added an answer on May 26, 2026 at 1:02 am

    Change tv2.setText((Integer)entry.getValue()); to

    tv2.setText(entry.getValue().toString());
    

    do like this

     TableRow tr1 = new TableRow(this);
    
     for (Entry<String, Integer> entry : map.entrySet()) {
    
            tv.setText(entry.getKey());
            tv2.setText((Integer)entry.getValue()); //Error occures here
    
            tv.setGravity(Gravity.LEFT);
            tv2.setGravity(Gravity.RIGHT);
    
            tr1.addView(tv);
            tr1.addView(tv2);
            tl.addView(tr1, new TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem right now and I don't know how to fix
I have a problem, that maven is looking for resources inside of Eclipse installation
I have this problem... I need to load an image from the resources of
I have a problem configuring BASIC-auth in jetty here's my web.xml <security-constraint> <web-resource-collection> <web-resource-name>resources</web-resource-name>
Here is the problem: I have a ListView as following: <UserControl.Resources> <DataTemplate x:Key="FirstCell"> <StackPanel
I have a nasty problem referencing resources when using a Maven project and Jar
I have a Problem with Nested Resources. 2 Models User => has_many :stuffs Stuff
I have a problem as follows: I have few office locations and resources with
I have a simple problem with admob here... I've tried all resources to add
I have problem with loading resources for UserControl from referenced assembly in Expression Blend

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.