Thursday, August 18, 2011


Resources NotFoundException

 The below Resources$NotFoundException log results from user error and is easily fixed.

 ERROR/AndroidRuntime(9202): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
08-18 12:32:14.057:
ERROR/AndroidRuntime(9202):   at android.content.res.Resources.getText(
08-18 12:32:14.057:
 ERROR/AndroidRuntime(9202):  at android.widget.TextView.setText(


I get this error when I am trying to set a View’s text using an integer value like:

 text.setText(SomeInteger) // This is incorrect !

Instead, to set the text of a view using an integer, you need to do:
text.setText(Integer.toString(SomeInteger)) // setText with an int
The problem is that setText(int) is reserved for string resource ids, like:
view.setText(R.string.someStringId) // setText with a string resource id



Check out this may be help you

Related Posts Plugin for WordPress, Blogger...