String[] columns = { "content", "optionA", "optionB", "optionC",
"optionD" };
String selection = "examSubject='" + ll_a
+ "' and chapter=? and type=? and difficult=? and num=?";
String[] selectionArgs = { "1", "1", "1", "10001" };
Cursor cursor = sqldb.query("q_question", columns, selection,
selectionArgs, null, null, null);
startManagingCursor(cursor);
Log.i("nnnnnnnnnnnn", cursor.getCount()
+ "nnnnnnnnnnnnn");//
显示的是0?????????????
while (cursor.moveToNext()) {
Log.i("valcontnet", cursor.getColumnIndex("content")
+ "cccccccccccc");
byte[] val = cursor.getBlob(cursor.getColumnIndex("content"));
Log.i("valcontnet", cursor.getColumnIndex("content")
+ "cccccccccccc");
byte[] vala =
cursor.getBlob(cursor.getColumnIndex("optionA"));
byte[] valb =
cursor.getBlob(cursor.getColumnIndex("optionB"));
byte[] valc =
cursor.getBlob(cursor.getColumnIndex("optionC"));
byte[] vald =
cursor.getBlob(cursor.getColumnIndex("optionD"));
try {
content.setText(new String(val, "GBK"));
opA.setText(new String(vala, "GBK"));
opB.setText(new String(valb, "GBK"));
opC.setText(new String(valc, "GBK"));
opD.setText(new String(vald, "GBK"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
图片上显示的是从数据库里查找到的数据,但是在android类里就查找不到,不知道为什么,请求帮助????