How to use unicode in Android resource?

后端 未结 2 799
天命终不由人
天命终不由人 2020-12-01 01:33

I want to use this unicode character in my resource file.

But whatever I do, I end with dalvikvm crash (tested with Android 2.3 and 4.2.2):



        
2条回答
  •  死守一世寂寞
    2020-12-01 02:03

    Do it this way

    Do not keep problematic emoji in the strings.xml

    add it programmatically

    Hi %1$s
    
    getString(R.string.hi_welcome_msg, user.getFullName() + " \uD83D\uDC4B" );
    

提交回复
热议问题