0
我在ORMLite documentation中看到存储的字符串必须使用Unicode符号String (DataType.STRING_BYTES)
。但我是否也要更改ArrayBytes的String属性?ORMLite显示重音符号和其他Unicode符号
直到现在我已经在我的String属性上面使用了@DatabaseField(dataType = DataType.STRING_BYTES),但这不起作用。
型号
@DatabaseTable(tableName="Messages")
public class Message {
@DatabaseField(dataType = DataType.STRING_BYTES)
private String message;
//get and set methods...
...
}
活动
...
TextView message = new TextView(this);
message.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
message.setText(m.getMessage());
linearLayout.addView(message);
...
我不能完全解析你的文章中的第二句话。你能编辑和重写它吗? – Gray 2012-07-23 14:47:08
你怎么知道它不工作?你能显示你的输入,数据库字节和输出吗? – Gray 2012-07-23 14:47:35
因为我在数据库中保存了文本,然后当我尝试恢复它时,消息显示为奇数符号。 – 2012-07-24 12:17:14