标签:os 使用 java sp 数据 on 问题 代码 bs
============问题描述============
============解决方案1============
int sum(SQLiteDatabase db) { Cursor cursor = db.rawQuery("select sum(e) from a", null); cursor.moveToNext(); int sum = cursor.getInt(0); cursor.close(); return sum; }
============解决方案2============
int sum() { SQLiteDatabase db = dbManger.getInstance(); Cursor cursor = db.rawQuery("select sum(e) from a", null); cursor.moveToNext(); int sum = cursor.getInt(0); cursor.close(); db.close(); return sum; }
标签:os 使用 java sp 数据 on 问题 代码 bs
原文地址:http://www.cnblogs.com/hugangyan86/p/4041969.html