Skip to content Skip to sidebar Skip to footer

Problems With Parse Query In Parseobject

I'm having trouble with this query. What i want to accomplish here is according to the idChatSeleccionadoAppUsuario(KYLmvSGP1…) i can have all the messages and User(Usuario) ins

Solution 1:

Finally this is the way to retrieve the query... it was always but this post could help a lot of people...

ParseQuery<ParseObject> query = ParseQuery.getQuery("Conversaciones");
    queryChat=ParseObject.createWithoutData("Chat",idChatSeleccionadoAppUsuario);
    query.whereEqualTo("ChatId", queryChat);
    query.include("Usuario");
    query.include("ChatId");
    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> objects, ParseException e) {
            for (ParseObject obj : objects) {
                mensaje = obj.getString("Mensaje");
                Log.i("UFF", "Este es el mensaje" + mensaje);

                enviaMensaje = (ParseUser) obj.get("Usuario");
                Log.i("UFF", "Este es el usuario del chat---->:" + enviaMensaje.getObjectId());

                chatId = obj.getParseObject("ChatId");
                Log.i("UFF", "Este es el id del chat---->:" + chatId);
                //idChatSeleccionado=chatId.getObjectId();
                listaDeMensajes.add(obj);


            }
            mMessageAdapter = new MessageListAdapter(getContext(), listaDeMensajes);
            mMessageRecycler.setAdapter(mMessageAdapter);
            queryFromChat();


        }
    });

}

Post a Comment for "Problems With Parse Query In Parseobject"