2012-07-26 50 views
1

我想使用電子郵件語法(如[email protected])來硬編碼字符串資源。 但是,eclipse彈出一個錯誤說「@」不能包含在內。Android XML輸入「@」?

'@'如何包含在字符串資源中。

謝謝你。在strings.xml中

添加字符串:

+0

即使編碼@如\ u0040不起作用 – Robert 2012-07-26 08:20:10

+0

但是這個工作對我來說@@@ – 2012-07-26 09:27:30

回答

1

試試這個

<string name="email">[email protected]</string> 

並嘗試設置這活動爲:

textView.setText(R.string.email);