Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Ricky Sparks
Ricky Sparks
22,249 Points

Really simple error that highlights a blank space where no code exist? (Screenshot available)

'class' or 'interface' expected?


1 Answer

Stone Preston
Stone Preston
42,016 Points

go through your code and makes sure each opening brace has a closing brace

Stone Preston
Stone Preston
42,016 Points

can you post the full class code please

Ricky Sparks
Ricky Sparks
22,249 Points
package com.patriothighschool.rickyjames1750.ribbit;

import android.app.AlertDialog;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.parse.FindCallback;
import com.parse.ParseException;
import com.parse.ParseQuery;
import com.parse.ParseRelation;
import com.parse.ParseUser;

import java.util.List;

public class FriendsFragment extends ListFragment {

    public static final String TAG = FriendsFragment.class.getSimpleName();

    protected ParseRelation<ParseUser> mFriendsRelation;
    protected ParseUser mCurrentUser;
    protected List<ParseUser> mFriends;

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_friends,
                container, false);

        return rootView;
   public void onResume() {
        mCurrentUser = ParseUser.getCurrentUser();
        mFriendsRelation = mCurrentUser.getRelation(ParseConstants.KEY_FRIENDS_RELATION);


        ParseQuery<ParseUser> query = mFriendsRelation.getQuery();
        query.findInBackground(new FindCallback<ParseUser>() {
            public void done(List<ParseUser> parseUsers, ParseException e) {

        mFriendsRelation.getQuery().findInBackground(new FindCallback<ParseUser>() {
            public void done(List<ParseUser> friends, ParseException e) {

                if (e == null) {
                        mFriends = friends;

                        String[] usernames = new String[mFriends.size()];
                        int i = 0;
                        for (ParseUser user : mFriends) {
                            usernames[i] = user.getUsername();
                        ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                else {

                    Log.e(TAG, e.getMessage());
                    AlertDialog.Builder builder = new AlertDialog.Builder(getListView().getContext());
                            .setPositiveButton(android.R.string.ok, null);
                    AlertDialog dialog = builder.create();