这是我将数据库值提取到listview
。
private void fetchData2() {
db = helper.getReadableDatabase();
Cursor c = db.query(DBhelper.TABLE2, null, null, null, null, null, null);
adapter = new SimpleCursorAdapter(
this,
R.layout.row2,
c,
new String[]{DBhelper.Amount},
new int[]{R.id.lbl});
list.setAdapter(adapter);
}
我只是想更改此代码以将值转换为文本视图,
答案 0 :(得分:1)
你可以这样做......
if(c.moveToFirst()){
String data = c.getString(c.getColumnIndex("Column's Index"));
yourTextView.setText(data);
}