How to set emoji by unicode in a textview? | Newbedev

文章推薦指數: 80 %
投票人數:10人

So Textview displays without Drawable. Try it with http://apps.timwhitlock.info/emoji/tables/unicode. You can directly use Emojis in string resources by ... MenuNEWBEDEVPythonJavascriptLinuxCheatsheetContactNEWBEDEVHowtosetemojibyunicodeinatextview?Foundasolution: InmyunicodeIreplaced'U+'by'0x' Example:replace'U+1F60A'by'0x1F60A' ThiswayIgotan'int'like intunicode=0x1F60A; Whichcanbeusedwith publicStringgetEmojiByUnicode(intunicode){ returnnewString(Character.toChars(unicode)); } SoTextviewdisplayswithoutDrawable Tryitwithhttp://apps.timwhitlock.info/emoji/tables/unicode YoucandirectlyuseEmojisinstringresourcesbyusingthedecimalcodelikethis: 😊 forexample: Iamhappy😊> Note:ForKotlin fungetEmoji(unicode:Int):String{ returnString(Character.toChars(unicode)) } Tags:AndroidUnicodeTextviewEncodeEmojiRelatedHowtodetectwhetherauserisusingUSBtethering?howtodisableremotewipeforExchange2010ActiveSync?AndroidsoftwareforthesystemadministratoronthemoveApple-HowtomigrateWhatsAppmessagesdatafromAndroidtoiPhone?Apple-TransferfilestoiPadviaUSBfromAndroidApple-Can'tallowblockedsoftware(HAXM)torunonmacOS10.13Apple-MountAndroidPhoneonDesktopApple-SyncGoogleKeeptoAppleNotesApple-HowdoIcopyfilesbetweenOSXandAndroid6overUSBcable?Apple-HowtosyncOSXReminderswithAndroid?PandashowtofindcolumncontainsacertainvalueRecommendedwaytoinstallmultiplePythonversionsonUbuntu20.04BuildsuperfastwebscraperwithPythonx100thanBeautifulSoup



請為這篇文章評分?