1 December 2012

How to solve problem with error android.content.res.Resources$NotFoundException: String resource ID in Android ?

You compailed your legendary app and ... your run and then ... you see error like that:

12-01 19:05:32.059: ERROR/AndroidRuntime(1124): FATAL EXCEPTION: main
android.content.res.Resources$NotFoundException: String resource ID #0x5a

You see that he complain about line which looks like this:

textView.setText(xyz.getIntValue());

Weird? You are damn sue that method  getIntValue()  return value and .. debug shows that it happen.So?
Well. It need be String .How to do it ?Use String.valueOf() method.

Simply surround int and other primitive with String.valueOf(xyz.getIntValue()) :)

Problem solved .

No comments:

Post a Comment