android.content.res.Resources$NotFoundException:String resource ID #0x05

出现这个问题后,发现view没错,tvCredit也没错,死活不知道原因,后来网上查到了原因,setText()里面的参数必须是String的,而本来的course.getCredit()是int型的。

TextView tvCredit = (TextView) view.findViewById(R.id.curri_course_item_credit);
tvCredit.setText(course.getCredit());

更改后就没问题了

TextView tvCredit = (TextView) view.findViewById(R.id.curri_course_item_credit);
tvCredit.setText(""+course.getCredit());

 

 

 

 

 

 

posted @ 2013-08-25 11:25  小猴偷米  Views(463)  Comments(0Edit  收藏  举报