From af149087d4f16db6be367be1e8dabedbc56b0591 Mon Sep 17 00:00:00 2001 From: Seyyed davud hosseiny Date: Thu, 15 Sep 2016 18:47:48 +0430 Subject: [PATCH] Update setText in normal TextView setText's CharSequence can be null and null converts to empty text. --- lib/src/github/ankushsachdeva/emojicon/EmojiconTextView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/github/ankushsachdeva/emojicon/EmojiconTextView.java b/lib/src/github/ankushsachdeva/emojicon/EmojiconTextView.java index 5822e47..f7cb2eb 100644 --- a/lib/src/github/ankushsachdeva/emojicon/EmojiconTextView.java +++ b/lib/src/github/ankushsachdeva/emojicon/EmojiconTextView.java @@ -62,6 +62,9 @@ private void init(AttributeSet attrs) { @Override public void setText(CharSequence text, BufferType type) { + if (text == null) { + text = ""; + } SpannableStringBuilder builder = new SpannableStringBuilder(text); EmojiconHandler.addEmojis(getContext(), builder, mEmojiconSize, mTextStart, mTextLength); super.setText(builder, type);