这是我的代码!我想将用户成本乘以 12。并且我想将此计数(成本 * 12)添加到列表视图中。但是由于列表适配器,我只将字符串列添加到列表视图中。如何还可以通过乘法添加整数值?
static final String KEY_ITEM= "USER_ID";
static final String KEY_NAME = "USER_NAME";
static final String KEY_SURNAME = "USER_SURNAME";
static final String KEY_DATE = "USER_DATE";
static final String KEY_COST="USER_COST";
HashMap<String, String> map = new HashMap<String, String>();
Element e = (Element) nl.item(i);
map.put(KEY_ITEM, conParser.getValue(e, KEY_ITEM));
map.put(KEY_NAME, conParser.getValue(e, KEY_NAME));
map.put(KEY_SURNAME, conParser.getValue(e, KEY_SURNAME));
map.put(KEY_DATE, conParser.getValue(e, KEY_DATE));
map.put(KEY_COST, conParser.getValue(e, KEY_COST));
items.add(map);
final ListAdapter adapter = new SimpleAdapter(this, items,
R.layout.list_item,
new String[] {KEY_ITEM,KEY_NAME,KEY_SURNAME,temp,KEY_DATE,KEY_COST}, new int[] {
R.id.kod, R.id.isim,R.id.kisi_sayisi,R.id.adisyon_sayisi,R.id.toplam_satis});
setListAdapter(adapter);