4
I want to return only two simple data in TextView using SQLite.
I have a common "Products" table and another temporary table "Information" I use SUM() to add the column of the first table. 
Dbhelper:
    public List<ProdutoDAO> getTotais() {
            List<ProdutoDAO> list = new ArrayList<ProdutoDAO>();
            db = this.getReadableDatabase();
            cursor = db.rawQuery("SELECT SUM(" + QUANTIDADE + ") AS " + TOTAL_QUANTIDADE + ", SUM(" + TOTAL + ") AS " + TOTAL_VALOR + " FROM " + TABLE, null);
            while (cursor.isAfterLast() == false) {
                ProdutoDAO produto = new ProdutoDAO();
                produto.setTotalValor(cursor.getString(cursor.getColumnIndex(TOTAL_VALOR)));
                produto.setTotalQuantidade(cursor.getString(cursor.getColumnIndex(TOTAL_QUANTIDADE)));
                list.add(produto);
                cursor.moveToLast();
            }
            return list;
        }
Can someone tell me what I’m doing wrong?
What error is occurring? Please explain or place the printStackTrace.
– Carlos Bridi