Gunvant Murge last month

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
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    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;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(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
             */
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

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

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

Answers


Charuka last month

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

https://github.com/rockerhieu/emojicon/issues/21

Post Status

Asked in last month
Viewed 1,987 times
Voted 10
Answered 1 times

Search




Leave an answer