Displaying emoticons in Android
I think it would be more useful to build Spannable. private static final Factory spannableFactory = Spannable.Factory .getInstance(); private static final Map<Pattern, Integer> emoticons = new HashMap<Pattern, Integer>(); static { addPattern(emoticons, “:)”, R.drawable.emo_im_happy); addPattern(emoticons, “:-)”, R.drawable.emo_im_happy); // … } private static void addPattern(Map<Pattern, Integer> map, String smile, int resource) { map.put(Pattern.compile(Pattern.quote(smile)), resource); } public static … Read more