Исключение составляет: Resources.NotFoundException
11-30 17: 38: 17,843: I / class fyp.proj.crud.DisplayProjects $ ListAdapter (967): android.content.res.Resources $ NotFoundException: строковый идентификатор ресурса # 0x9
Во-первых, я уже рассмотрел несколько ответов, но это кажется немного более конкретным.
У меня есть реальные трудности с отслеживаниемпроблема с ListAdapter, элементы не отображают ничего, что я знаю, исключение выдается, потому что оно перехвачено, и я пытаюсь зарегистрировать его - однако весь журнал говорит:
11-30 15:33:06.703: I / class fyp.proj.crud.DisplayPlacements $ ListAdapter (400): Строковый идентификатор ресурса # 0x7
установлены значения, которые я пытаюсь вставить в элемент списка, довольно грубый sys.err доказываетэтот.также стоит отметить, что количество элементов в списке увеличивается при вставке или удалении данных, его просто не видно
код ниже.
/* ListAdapter */
private class ListAdapter extends ArrayAdapter<Placement> {
private ArrayList<Placement> mList;
public ListAdapter(Context context, int textViewResourceId,
ArrayList<Placement> list) {
super(context, textViewResourceId, list);
this.mList = list;
}
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
try {
if (view == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(R.layout.list_item, null);
}
final Placement p = mList.get(position);
if (p != null) {
// setting list_item views
/* some error in here means that the items aren't being set */
System.err.println(p.getTitle() + " "
+ p.getId());
/*
* this sys.err gets the details sucessfully from the
* placement object
*/
((TextView) view.findViewById(R.id.tv_id)).setText(p
.getId());
((TextView) view.findViewById(R.id.tv_title)).setText(p
.getTitle());
((TextView) view.findViewById(R.id.tv_desc)).setText(p
.getDesc());
}
} catch (Exception e) {
Log.i(DisplayProjects.ListAdapter.class.toString(),
e.getMessage());
}
return view;
}