public ArrayList calculateTotal() {
SQLiteDatabase db = this.getWritableDatabase();
ArrayList<Integer> array_list2 = new ArrayList<Integer>();
Cursor cursor1 = db.rawQuery(
"SELECT SUM(cost) FROM expense", null);
if (cursor1.moveToFirst()) {
columntotal = cursor1.getFloat(0);
}
cursor1.close();
db.rawQuery("INSERT INTO total VALUES(columntotal)", null);
I'm unable to sum up the cost and display in android studio....