Gunvant Murge 5 days ago

How to use Emojicon in fragment

I am used in fragment.

error java.lang.IllegalArgumentException: MainActivity@a3d41ec must implement interface OnEmojiconBackspaceClickedListener

public class Chat extends Fragment implements EmojiconGridFragment.OnEmojiconClickedListener,
        EmojiconsFragment.OnEmojiconBackspaceClickedListener {

    EmojiconEditText mEditEmojicon;
    EmojiconTextView mTxtEmojicon;
    public Chat() {
        // Required empty public constructor

    public void onCreate(Bundle savedInstanceState) {

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_chat, container, false);

        mEditEmojicon = (EmojiconEditText) view.findViewById(;
        mTxtEmojicon = (EmojiconTextView) view.findViewById(;

        return view;

    public void onActivityCreated(@Nullable Bundle savedInstanceState) {

        mEditEmojicon.addTextChangedListener(new TextWatcher() {

             * This notify that, within s,
             * the count characters beginning at start are about to be replaced by new text with length
             * @param s
             * @param start
             * @param count
             * @param after
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

             * This notify that, somewhere within s, the text has been changed.
             * @param s
            public void afterTextChanged(Editable s) {}

             * This notify that, within s, the count characters beg        


Charuka 4 days ago

The host Activity must implement the interface for handling back button click not in the Fragment where you have done

Post Status

Asked in 5 days ago
Viewed 1,987 times
Voted 10
Answered 1 times


Leave an answer