Skip to content
Advertisement

Problem resolving an android.content.res.Resources error

I understand that this error has been addressed severally and I’ve checked most of them like Android: android.content.res.Resources$NotFoundException: String resource ID #0x5, android.content.res.Resources$NotFoundException: String resource ID to see if I could find a solution to my problem but I couldn’t and most of them are hard to understand. I can’t tell if my code is an int/string so I don’t know exactly what to correct, so I need help.

I got this error at runtime:

JavaScript

My codes:

HomeActivity.java

JavaScript

FirstFragment.java

JavaScript

In my String.xml:

JavaScript

Advertisement

Answer

JavaScript

As shown above, the exception is raised in HomeActivity in onResponse() method line (66) where you try to set a text into a TextView.

So, In HomeActivity you’ve:

JavaScript

And as per documentation, .getDt() returns an integer, so you can’t set it directly to TextView unless you convert it to a String.

To solve this, replace that line of code with one of:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement