I\'m developing an Android app which reads data from MySQL database and I faced this error. I have this XML layout:
Change
dateTime.setText(app.getTotalDl());
To
dateTime.setText(String.valueOf(app.getTotalDl()));
There are different versions of setText
- one takes a String and one takes an int resource id. If you pass it an integer it will try to look for the corresponding string resource id - which it can't find, which is your error.
I guess app.getTotalDl()
returns an int. You need to specifically tell setText
to set it to the String value of this int.
setText (int resid) vs setText (CharSequence text)