0

I am having issued Retrieving objects from Parse.com. I plan to have a list of anywhere from 3 to 25 objects displayed, They will change daily. I will not know the ObjectID, or any of the content of the object. I followed this guide the best I could.

I wrote this code here to simplify what I am doing. It is throwing a null pointer exception in my .done.

UPDATED

Saving my object: //I am doing this successfully

            ParseObject testObject = new ParseObject("TestObject");
            testObject.put("TheColumn", "The name in the column");
            testObject.saveInBackground();
            Context context = getApplicationContext();
            Toast toast = Toast.makeText(context, "Saved", Toast.LENGTH_LONG);
            toast.show();

Retrieving my Object //Unsuccessfully....

          ParseQuery<ParseObject> query  = ParseQuery.getQuery("TestObject");

            query.findInBackground(new FindCallback<ParseObject>() {
                @Override
                public void done(List<ParseObject> parseObjects, com.parse.ParseException e) {
                    if (e==null){

                        Log.d("THE OBJECT", "" +parseObjects.size());


                        name =  parseObjects.toString();
                        Log.d("THE QUERY ", "" + name);

                    } else {
                        Log.d("ERROR:", "" + e.getMessage());
                    }
                }
            });

In my logcat, I get my Log.d's to log. I get two; D/THE OBJECT: 1 and D/THE QUERY: [com.parse.ParseObject@XXXXXX] But if I try to set it to a TextView, I get a nullPointerException.

Why am I getting data returned like this? I feel I am following this guide closely.

4

1 回答 1

0

我的原因是我意外地nullpointer将文本设置为TextView另一个班级。搞得我r.id一头雾水。

于 2013-07-29T23:13:11.223 回答