Android sqlite Cursor值为文本框

时间:2011-10-12 11:08:58

标签: android sqlite

text = (TextView)findViewById(R.id.textView123);

Cursor sum = dbObject.rawQuery("SELECT Sum(Volume) FROM SHARE WHERE _id2 LIKE ?",
                 new String[] { "%" + val1 + "%" });

如何将 sum 值赋予TextView?

提前谢谢你,

1 个答案:

答案 0 :(得分:0)

this.startManagingCursor(sum); //or any (Activity) .startManagingCursor

sum.moveToFirst();

text.setText(sum.getString(0));