Pages

Monday 2 April 2012

Resources NotFoundException

Error:-
         I got following error while Debugging OF my Application.
 
          Uncaught handler: thread main exiting due to uncaught exception
android.content.res.Resources$NotFoundException: String resource ID #0x1


I got this error when i am trying to fetch data from database and try to assign this data to EditText.

I had one integer return type method which return NoOfQuestion  which i want to show in EditText like this..

txtNoQuestion.setText((owq.getNoOfQuestion()));        //Incorrect        txtNoMarks.setText((owq.getMarks()));                        //Incorrect

Then i use following method and it solve my Problem.

txtNoQuestion.setText(Integer.toString(owq.getNoOfQuestion()));   //Correct                        txtNoMarks.setText(Integer.toString(owq.getMarks()));                 //correct                                



Enjoy......

SAVE TREE SAVE LIFE 

No comments:

Post a Comment