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


search method in ribbit

I'm develop the search method so that you can search users the code it's that one.

    searchText = (EditText)findViewById(R.id.inputSearch);
    searchButton = (Button)findViewById(R.id.Search);
    searchButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            String searchedUser = searchText.getText().toString();
            searchedUser = searchedUser.trim();
            if (searchedUser.isEmpty()) {
                AlertDialog.Builder builder = new AlertDialog.Builder(EditFriendsActivity.this);
                    .setPositiveButton(android.R.string.ok, null);
                AlertDialog dialog = builder.create();
            else {
                //search for the user!
                ParseQuery<ParseUser> query = ParseQuery.getQuery(searchedUser);
                query.whereEqualTo("username", searchedUser);
                query.findInBackground(new FindCallback<ParseUser>() {
                    public void done(List<ParseUser> searchList, ParseException e) {
                        if (e == null) {
                            searchedUserList = searchList;

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

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



Cant figure out why I continue to see the progress bar and nothing is added to the list

2 Answers

I believe,

.getQuery() is a method belonging to the class ParseUser not ParseQuery. Example:

ParseQuery<ParseUser> query = ParseUser.getQuery(searchedUser);

as indicated here:Parse Documentation

before this if (e == null) { add this

it will make loader disappear after the query is done