I am trying to add emoticons/emoji in Snackbar/Toast notification. Do this emoticons need to be image resource or Unicode character. I am getting string output when i use unicode character from following website Unicode Character Website.
Snackbar.make(findViewById(android.R.id.content), \U+1F601 + "Done", Snackbar.LENGTH_LONG).show();
After cross referencing Supported Unicode Sequences as well as the Visual Unicode Database I realized that \u1F601 was a 32 bit Unicode representation, and the 16bit representation can be set like :
Toast.makeText(this, "Smileys = " + ("\ud83d\ude01"),Toast.LENGTH_LONG).show();
Change the last digit of ("\ud83d\ude01")
unicode to change the smiley
Refer these links
http://apps.timwhitlock.info/emoji/tables/unicode#note1
http://www.charbase.com/1F601
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With