Skip to content

send method not working #8

@relferreira

Description

@relferreira

In the Android example, this method is not sending the message

public void sendMessage(View view) {
        EditText editText = (EditText)findViewById(R.id.message);
        mWebSocketClient.send(editText.getText().toString());
        editText.setText("");
    }

I get the following exception:

org.java_websocket.exceptions.WebsocketNotConnectedException

I have checked, and the onOpen method is called, and the onClose is not called.
I also checked that calling the "send" method inside one of the Overrided methods, like onMessage, it works.

Am I doing something wrong? I want to send a message with the click of an item in a listview.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions