0

When running the code it shows me this error,

  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.github.bassaer.chatmessageview.view.ChatView.setOnClickSendButtonListener(android.view.View$OnClickListener)' on a null object reference
                      at com.example.joshua.app.ChatView.onCreate(ChatView.kt:62)

This is my code The first line is where the error shows...

   my_chat_view.setOnClickSendButtonListener(listener = View.OnClickListener {
            my_chat_view.send(Message.Builder()
                    .setUser(human)
                    .setRight(true)
                    .setText(my_chat_view.inputText)
                    .build()
            )
Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
Joshua Santiago
  • 127
  • 2
  • 11

1 Answers1

0

my_chat_view is a null, so it's not initialized (that's what the error is saying - you are calling setOnClickSendButtonListener on a null). You should have probably provided more code to get help with this.

TinyPi
  • 16
  • 2