Home Ask Login Register

Developers Planet

Your answer is one click away!

Gunvant Murge January 2017

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(R.id.editEmojicon);
        mTxtEmojicon = (EmojiconTextView) view.findViewById(R.id.txtEmojicon);

        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 January 2017

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


Post Status

Asked in January 2017
Viewed 1,987 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life