Resources$NotFoundException in Android
<p>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!</p>

<p>Calling:</p>

<pre><code>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);
            }
          }
</code></pre>

<p>Pizza:</p>

<pre><code>public class Pizza implements Comparable&lt;String&gt; {

    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);
    }

}
</code></pre>

<p>Error Code:</p>

<pre><code>for (Entry&lt;String, Integer&gt; 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));
            }
        }
</code></pre>

<p>Error:</p>

<pre><code>10-04 09:04:40.475: ERROR/AndroidRuntime(954): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
</code></pre>
