Browse SDKs · Android
Platform
SDKsAndroid

Create a reply message

Use createQuoteMessage to reply while quoting an existing message.

Copy

Construct a reply message referencing a previous message in the conversation. Provide the reply text and the original Message object being quoted; receiving clients display the reply alongside a preview bubble of the referenced message.

Code example

String replyText = "Understood, I will handle it shortly.";

Message message = OpenIMClient.getInstance().messageManager.createQuoteMessage(
    replyText,
    quotedMessage
);

Parameters

ParameterTypeRequiredDescription
textStringYesText content of the reply message.
quotedMessageMessageYesThe complete historical Message object being referenced.

Return value

Returns the created Message object with contentType set to MessageType.QUOTE.

State changes after the call

  1. Local initialization: Initializes the local Message structure without sending data to the server.
  2. Transmission: Call Send a message to deliver the quote-reply message to a single user or group.