I’m trying to make a forum using backendless for Android,and at the moment of sending and receiving them , those messages are sent three and even four times in my layout however in channles and table messaging they appear once and this is right , but why does it happen when sending messages to be shown in layout?
public void MostrarComentarios()
{
//FILTRAR POR OBJECT_ID ID DE LA PREGUNTA
StringBuilder whereClause = new StringBuilder();
whereClause.append(“Pregunta_por_categoria[comentarios]”);
whereClause.append(".objectId=’").append(id_pregunta).append("’");
BackendlessDataQuery dataQuery = new BackendlessDataQuery();
dataQuery.setWhereClause(whereClause.toString());
Backendless.Data.of(Comentarios.class).findLast(new AsyncCallback<Comentarios>() {
@Override
public void handleResponse(Comentarios response)
{
AgregarMensajeHistorial(response.getComentario(),url_foto_publicador);
}
@Override
public void handleFault(BackendlessFault fault) {
}
});
in the suscrptionResponder, the code line below means that if the current user is publishing a message ,then this message won’t be shown in current user’s scrollview as “message received” because this message will be duplicated so that this message is published by the current user because the current user is also a susbcriber in some moment of the forum… I hope you understand my idea
if (!current_user.getObjectId().equals(id_publicador))
{ showToast("TODO SALIO BIEN MESSAGE SUBSCRIBING ");
MostrarComentarios();
//AgregarMensajeHistorial((String) message.getData(),url_foto_publicador);
}
Hi dear Sergey, I could see Toast in my app If I want,but this is not the case, the messages I receive from the server are displayed in my app successfully , but the issue is that these messages are displayed once ,twice and tree times in my app ,however in console and channles and Table Storage these messages are dsiplayed just once and this is right, the problem is in my app
It sounds like a problem in the way you’re using the APIs, which means the problem is in your code. We would be happy to take a look at your code and assist with fixing the problem, however, it is outside of the support we provide through the forum. If you would like to get our assistance with your project, please contact Backendless sales (sales@backendless.com) to get a quote. This is something that our Services team can help with.
Hi dear Sergey, I could see Toast in my app If I want,but this is not the case, the messages I receive from the server are displayed in my app successfully , but the issues is that these messages are displayed once ,twice and tree times in my app ,however in console and channles and Table Storage these messages are dsiplayed just once and this is rifht, the problem is in my app