Neh*_*gla 2 android datepicker
我想在我的项目中使用datepicker.但是一旦我运行该项目,它就会抛出"资源未找到异常",当我在xml文件中拖动datepicker时会出现以下行
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)
Run Code Online (Sandbox Code Playgroud)
logcat条目如下:
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
Run Code Online (Sandbox Code Playgroud)
我该如何纠正代码.提前致谢.
Pra*_*ani 11
android.content.res.Resources $ NotFoundException:字符串资源ID#0x16
您正在尝试设置int值
tetview.setText()或者Toast.makeText(),它将作为字符串资源ID.
所以试着像这样给出int值
.setText(""+intvalue) 要么 Toast.makeText(context,""+intvalue,..)
| 归档时间: |
|
| 查看次数: |
3595 次 |
| 最近记录: |