这是我获取查询的功能:
public Cursor getSaldo(String id) {
String[] args={id};
return(getReadableDatabase()
.rawQuery("SELECT sum("+t_jumlah+") "+
"as "+t_saldo+" "+
"FROM "+t_table+" WHERE "+t_nId+"=?", args));
如何将数据放入我的TextView
?
我有这样的光标
almagId=getIntent().getStringExtra(Nasabah.ID_EXTRA);
Cursor c=helper.getSaldo(almagId);
startManagingCursor(c);
答案 0 :(得分:0)
if(!cursor.moveToFirst()){
mytextView.setText("No output");
}
else{
do {
mytextView.setText(cursor.getString(0));
} while (cursor.moveToNext());