android.content.res.Resources$NotFoundException: String resource ID #0x0
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)
Replace
dateTime.setText(app.getTotalDl());
With
dateTime.setText(""+app.getTotalDl());
If we get the value as int
and we set it to String
, the error occurs. PFB my solution,
Textview = tv_property_count;
int property_id;
tv_property_count.setText(String.valueOf(property_id));