Skip to content Skip to sidebar Skip to footer

Android - Gridadapter Issue With Parse Server Sdk

I'm getting into Android and I'm an absolute beginner with that, so I hope you can help me with an issue with my custom GridAdapter and Parse SDK, the Logcat doesn't show me any er

Solution 1:

You can set final Context variable in Activity class. Use this variable in the innerClass(FindCallback)

public  void queryEvents() {
    final Context myContext= this;
    ParseQuery<ParseObject> query = ParseQuery.getQuery(Configs.EVENTS_CLASS_NAME);
    query.whereEqualTo(Configs.EVENTS_IS_PENDING, false);
    query.orderByAscending(Configs.EVENTS_END_DATE);
    query.findInBackground(new FindCallback<ParseObject>() {
        public void done(List<ParseObject> objects, ParseException error) {

            ....
            public GridAdapter(Context context, List<ParseObject> objects) {
                super();
                this.context = context;
                eventsArray = objects;
            }
            ...
            eventsGrid.setAdapter(new GridAdapter(myContext, eventsArray));

        }
    });
}

Post a Comment for "Android - Gridadapter Issue With Parse Server Sdk"