0

我在ORMLite 文档 中看到了存储带有 unicode 符号的字符串,你必须使用String (DataType.STRING_BYTES). 但是我是否也要更改 ArrayBytes 的 String 属性?

到目前为止,我在我的 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);
...
4

1 回答 1

0

这是 Eclipse 的问题。这段代码运行完美。有时出于某种原因,Eclipse 已将一些符号(如重音符号和其他特殊字母)替换为奇数符号。它在保存我的源代码时正在这样做。

于 2012-07-24T12:15:23.687 回答