//遍历所有账单 private void selectAll(){ List list=new ArrayList(); ListDBAdapter adapter=new ListDBAdapter(this,list); listView.setAdapter(adapter); //数据库的列数 int count=dbUtil.select().getColumnCount(); //获得的数据库游标 Cursor c=dbUtil.select(); while (c.moveToNext()){ OrderHistory history=new OrderHistory(); for (int i = 0; i < count; i++) { history.set_id(c.getInt(0)); history.setPay_number(c.getString(1)); history.setAmount_paid(c.getDouble(2)); history.setTaam(c.getDouble(3)); history.setOrder_amount(c.getDouble(4)); history.setBilling_method(c.getInt(5)); history.setBilling_number(c.getString(6)); history.setDate(c.getString(7)); history.setTimestamp(c.getLong(8)); history.setPayee(c.getString(9)); history.setIntegral(c.getInt(10)); history.setIs_sync(c.getInt(11)); history.setPay_state(c.getInt(12)); history.setIs_print(c.getInt(13)); history.setMonth(c.getInt(14)); history.setDay(c.getInt(15)); } list.add(history); }
看你多到什么程度,几万条几十万条肯定不会,最多就是消耗的内存多一些吧。
不会,不过你也需要注意数据库的优化。