我想将一个长字符串存储到android的sqlite中。我通过以下方式将其写入sqlite:
String content = bodytext.toString();
byte[] contentByte = content.getBytes();
Log.d("bytetoString",new String(contentByte));
String sql1 = "insert into content(id,content) values( '" + messageID
+ "','" + contentByte + "');";
db.execSQL(sql1);
我通过以下方式阅读:
String sql = "select * from content where id='" + messageID + "'";
Cursor temp = db.rawQuery(sql, null);
if (temp.moveToNext()) {
byte[] contentByte = temp.getBlob(temp.getColumnIndex("content"));
String sb = new String(contentByte);
Log.d("String",sb);
temp.close();
return sb;
}
但是,当我打印我刚刚阅读的字符串时。它打印出类似“[B@41431930??”的东西有什么问题吗?