android.content.res.Resources$NotFoundException: String resource ID #0x1 Error

Instead of

rollNo.setText(items[position].getRollNo());

you should use

rollNo.setText(Integer.toString(items[position].getRollNo()));

If you try to set integer as text, you call method setText(int resID) and application try to set as text some string resource with this resID.


SetText doesnt allow integer values

Just Add ""+ for your code to look like this ""+rollNo.setText(items[position].getRollNo());

this error occurs because setText does not take Integers, it takes Strings


You can also use

String.ValueOf()

in your code to avoid the Resource Not Found Exception .

Your code will look like this

rollNo.setText(String.ValueOf(items[position].getRollNo()));

It will work perfectly fine because the SetText() only requires strings as values to be passed on.