public View getView(int i, View view, ViewGroup viewGroup) {
view = layoutInflater.from(context).inflate(R.layout.device_transcription_list_item, viewGroup,false);
TextView idContainer = view.findViewById(R.id.device_id);
idContainer.setText(data.get(i).getId());
return view;
}
Android Studio 中 TextView对象如果在set方法中直接传入数字,会默认重载为resourse id而报错,为了避免系统错误将输入归类为resourse id应当避免直接传入数字:例如加上一些字符串,如下图
public View getView(int i, View view, ViewGroup viewGroup) {
view = layoutInflater.from(context).inflate(R.layout.device_transcription_list_item, viewGroup,false);
TextView idContainer = view.findViewById(R.id.device_id);
idContainer.setText(". " + data.get(i).getId());
return view;
}