I am trying to use datepicker in my project. But as soon as I run the project, it throws "Resource not found exception" and following line appears when I drag datepicker in xml file
The following classes could not be found:
- CalendarView (Change to android.widget.CalendarView, Fix Build Path, Edit XML)
- DatePicker (Change to android.widget.DatePicker, Fix Build Path, Edit XML)
logcat entries are as follows:
FATAL EXCEPTION:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dateandtimepick/com.example.dateandtimepick.MainActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x16
How can I rectify the code. Thanks in advance.
android.content.res.Resources$NotFoundException: String resource ID #0x16
You are trying to set int value in
tetview.setText() or Toast.makeText(), which it will take as string resource id.
So try to give int value in like this
.setText(""+intvalue) or Toast.makeText(context,""+intvalue,..)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With