diff --git a/src/org/thoughtcrime/securesms/util/Emoji.java b/src/org/thoughtcrime/securesms/util/Emoji.java index 1d8e34d61e..e50b33b8e9 100644 --- a/src/org/thoughtcrime/securesms/util/Emoji.java +++ b/src/org/thoughtcrime/securesms/util/Emoji.java @@ -263,7 +263,8 @@ public class Emoji { } public Pair getRecentlyUsed(int position, double size, PageLoadedListener pageLoadedListener) { - String code = EmojiLRU.getRecentlyUsed(context)[position]; + String[] recentlyUsed = EmojiLRU.getRecentlyUsed(context); + String code = recentlyUsed[recentlyUsed.length - 1 - position]; return new Pair(Integer.parseInt(code, 16), getEmojiDrawable(code, size, pageLoadedListener)); } @@ -329,6 +330,7 @@ public class Emoji { prefs = PreferenceManager.getDefaultSharedPreferences(context); } + recentlyUsed.remove(asset); recentlyUsed.add(asset); if (recentlyUsed.size() > EMOJI_LRU_SIZE) {