Parse Query "cannot resolve symbol"

1.5k views Asked by At

I'm working on Parse with android and I need to query some data stored. But I am unable to use any query command except for query.CachePolicy. All the other methods like query.getFirstinBackground are turned red and studio says "cannot resolve symbol".

I have ensured that I included the necessary imports such as com.Parse.Query and com.Parse.Object. But I'm unable to use any query operations.

This is the code I'm trying to add

ParseQuery<ParseObject> query = ParseQuery.getQuery("Posted");
    query.getFirstInBackground(new GetCallback<ParseObject>() {
    public void done(ParseObject object, ParseException e) {
        if (object == null) {
            Log.d("RBSE", "The getFirst request failed.");
        } else {
            // got the most recently modified object... do something with it here
        }
    }
}

Why am I getting this problem?

1

There are 1 answers

0
Shankar S On BEST ANSWER

Looks like, I used the query statements under wrong class in my java file. Using them on under onActivityCreated class, solved the problem.