Resource Not Found Textview

Resource not found TextView

mRow is an integer. When you call setText(mRow) on line 75, it thinks that you are trying to set the text with a String resource with ID = the value of mRow.

Instead, do:

tRow.setText(Integer.toString(mRow));

How to solve resource not found exception & onBindViewHolder?

You are setting integer value TextView, basically integer value in TextView navigate to resource file with that ID. So rather use integer value as it, wrap it with String.

So make below changes in your code on plus button click.

holder.count.setText(String.valueOf(product.getCount() + 1));

And in minus button click.

holder.count.setText(String.valueOf(product.getCount() - 1));

Android: Resources Not Found Exception

I see one mistake in your code..

please use this line

customYearView.setText(""+currentCustomYear);

instead of this

customYearView.setText(currentCustomYear);

As TextView accepts String value.

resource not found error in android app

I supppose, song-ID is an integer: Then convert it to a string and you'll be fine:

songHolder.txtSongId.setText(song.getSongID()+"");

Explanation: There are two setText() methods, one expecting a String parameter, is used to set text directly, the other, expecting an int parameter is actually expecting a resource id like R.string.app_name and if your song-ID is an integer, you've accidently invoked the later version which is expecting a resource id, hence the error.

Resource not found exception while trying to add recylerview to a fragment

It is possible that one or many of your listItem attributes return an integer like getScore and getFee. So let's look at the implementation of TextView.setText(int)

public final void setText(int resid) {
...
}

As you can see, it only accepts the int as a resource id like R.string.something.
So what you can do here is to make your int become string when setText like

holder.playerPoints.setText(listItem.getScore().toString());


Related Topics



Leave a reply



Submit