MainData myDBHlpr = new MainData(getActivity());
Cursor csr = myDBHlpr.getAllQuestions(UsageSettings.this);
while (csr.moveToFirst()) {
mMostMessagesSent.setText(csr.getString(csr.getColumnIndex("Reviews")));
mMostMessagesSent.setTextColor(Color.WHITE);
}
我检查了行数,结果显示为16
然后我检查了
Log.d("TAG", csr.getString(cst.getColumnIndex("Reviews")));
它显示错误消息说Log需要消息(这意味着它为空)
但是为什么即使表有16行并且列名存在,它也显示为空
帮助方法
public Cursor getAllQuestions(UsageSettings usageSettings) {
return this.getWritableDatabase().query(TABLE_NAME,null,null,null,null,null,null);
}