TextVeiw 的 No package identifier when getting value for resource numb
2015-10-04 19:48
363 查看
tv_title,tv_detail,tv_comment都是TextView;
newInfo.getComment()得到的是int类型
这段代码会抛 No package identifier when getting value for resource numb 异常
原因:TextView 的setText方法把传入的int类型的值当做资源Id到项目中查询资源,而资源中却找不到相应的数值,就会报NotFoundException的错误。
解决:
1.
2.
newInfo.getComment()得到的是int类型
tv_title.setText(newInfo.getTitle()); tv_detail.setText(newInfo.getDetail()); tv_comment.setText(newInfo.getComment());
这段代码会抛 No package identifier when getting value for resource numb 异常
原因:TextView 的setText方法把传入的int类型的值当做资源Id到项目中查询资源,而资源中却找不到相应的数值,就会报NotFoundException的错误。
解决:
1.
tv_comment.setText(String.valueOf(newInfo.getComment()));
2.
tv_comment.setText(newInfo.getComment()+"");
相关文章推荐
- Servlet的学习之Request请求对象(1)
- UI课程11 自定义cell及自适应高度
- codeforces 163A A. Substring and Subsequence(dp)
- UIPickerView控件的使用
- 63. Unique Paths II (Graph; DP)
- 62. Unique Paths (Graph; DP)
- UI 过后的杂谈
- SpriteBuilder修改CCB文件中的子CCB文件需要注意的一个地方
- SpriteBuilder修改CCB文件中的子CCB文件需要注意的一个地方
- SpriteBuilder修改CCB文件中的子CCB文件需要注意的一个地方
- String,StringBuffer与StringBuilder的区别??
- 126. Word Ladder II(Map, set, adj, Queue; BFS)
- UVa12166 Equilibrium Mobile(修改天平)
- iOS UI 基础
- UINavigationController
- 黑马程序员——Java基础---GUI
- LeetCode -- Unique Paths
- hdu 5496 Beauty of Sequence
- 74. Search a 2D Matrix (Graph; Divide-and-Conquer)
- APUE读书笔记(一):Unix基础知识、文件I/O