cannot be resolved or is not a field错误修订
今天写个简单的listview的使用实例,eclipse发现了一处错误,提示
tvSongName cannot be resolved or is not a field
代码如下:
TextView tvSongName = (TextView)view.findViewById(R.id.tvSongName);
当时比较纳闷,我明明在XML中定义了这个控件,怎么还无法解析呢?
后来才知道,我import了import android.R,删掉这行后,代码就正常了