diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartConversationActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/EmojiWrapper.java | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index 23a0bf011..5e7d8f0f1 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -72,6 +72,7 @@ import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.ListItem; import de.pixart.messenger.entities.Presence; +import de.pixart.messenger.services.EmojiService; import de.pixart.messenger.services.XmppConnectionService.OnRosterUpdate; import de.pixart.messenger.ui.adapter.KnownHostsAdapter; import de.pixart.messenger.ui.adapter.ListItemAdapter; @@ -272,6 +273,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + new EmojiService(this).init(); setContentView(R.layout.activity_start_conversation); mViewPager = findViewById(R.id.start_conversation_view_pager); ActionBar actionBar = getActionBar(); diff --git a/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java b/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java index db2bf1242..d30c68a97 100644 --- a/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java +++ b/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java @@ -33,10 +33,13 @@ import android.support.text.emoji.EmojiCompat; public class EmojiWrapper { public static CharSequence transform(CharSequence input) { - final CharSequence charSequence; - if (EmojiCompat.get().getLoadState() == EmojiCompat.LOAD_STATE_SUCCEEDED) { - return EmojiCompat.get().process(input); - } else { + try { + if (EmojiCompat.get().getLoadState() == EmojiCompat.LOAD_STATE_SUCCEEDED) { + return EmojiCompat.get().process(input); + } else { + return input; + } + } catch (IllegalStateException e) { return input; } } |