我有一个列表,其中包含从sqlite db加载的自定义布局。自定义布局中的一个项是整数。我想总结所有这些价值观。
这是我的代码:
Cursor cursor = db.rawQuery(query, null);
ItemsCursorAdapter adapter = new ItemsCursorAdapter(
this, R.layout.row_layout, cursor, 0 );
this.setListAdapter(adapter);
adapter.notifyDataSetChanged();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View vi = inflater.inflate(R.layout.row_layout, null);
TextView amount = (TextView)vi.findViewById(R.id.valueText);
String amountSt = amount.getText().toString();
int amountInt = Integer.getInteger(amountSt);