Recover data from Parser.com pointer type

Asked

Viewed 37 times

-1

I have the table in the Parser database, which is called Comentario.

Inside it I have the comment field and a field called "pointer" pointer that points to the objectId of another table called Image. Therefore, I need to show all the comments that are related to this photo. I’m doing it this way:

Parsequery query = Parsequery.getQuery("Comment");

query.whereEqualTo("pointer", obID);

query.findInBackground(new Findcallback() {

What am I doing wrong? Shows nothing!

1 answer

0

I decided as follows:

Parsequery query = Parsequery.getQuery("Comment"); query.whereEqualTo("pointer", obID); query.findInBackground(new Findcallback() {

        public void done(List<ParseObject> commentList, ParseException e) {

            if (e == null) {//lista com sucesso

               // for (ParseObject object: commentList) {

                 //   Log.i("ListarDados", "Comentario:  " + object.get("comentario"));
                //}
                Log.i("ListarDados"," Sucesso ao listar comentarios"+ commentList.size());


            } else { // lista sem sucesso

                Log.i("ListarDados"," Erro ao listar comentarios"+ e.getMessage());

            }

        }
    });

the error was on how I was saving in the database!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.