Can you try this
<EditTextPreference
android:title="@string/pref_char_pares_title"
android:summary="@string/pref_char_pares_summary"
android:key="charseppares"
android:defaultValue="\@"/>
문제
I want to include an item in my preferences.xml
file that it contains a special character @
.
<EditTextPreference
android:title="@string/pref_char_pares_title"
android:summary="@string/pref_char_pares_summary"
android:key="charseppares"
android:defaultValue="@"/>
But I have an error in line android:defaultValue="@"
(error: Error: No resource type specified (at 'defaultValue' with value '@').
I want to use the character @ like separator character in my strings. Thanks in Advance
해결책
Can you try this
<EditTextPreference
android:title="@string/pref_char_pares_title"
android:summary="@string/pref_char_pares_summary"
android:key="charseppares"
android:defaultValue="\@"/>
다른 팁
//you can also use like this to show special char
Unicode number: U+0040
HTML-code: @
Little late, but I had the same problem and maybe it will be helpful for somebody.
<EditTextPreference
android:title="@string/pref_char_pares_title"
android:summary="@string/pref_char_pares_summary"
android:key="charseppares"
android:defaultValue="\u0040"/>