title: Using FirebaseListAdapter to display a list of User
body: <p>I'm trying to add a "Search User" Activity to a simple App I'm trying to make. But I'm having trouble taking the user input (from a SearchView) and using it to make a query into the Firebase Database to finally display everything in a Listview (using FirebaseListAdapter).</p>
  
  <p>The problem is mainly with the Firebase part that I can't really figure out. Here is the code: </p>
  
  <pre><code>SearchView userSearchView;
  ListView userListView;
  SearchUserListAdapter UserAdapter;
  String currentUserName;
  String currentEnteredQuery = null;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_search_user);
  
      userSearchView = (SearchView) findViewById(R.id.user_searchview);
      userListView = ( ListView) findViewById(R.id.listview_search);
      final Intent startConversation = new Intent(this,ConversationActivity.class);
  
      //Start a new conversation
      userListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              startActivity(startConversation);
          }
      });
  
      Query query = UserDbRef.orderByChild(currentEnteredQuery);
      final FirebaseListAdapter firebaseListAdapter = new FirebaseListAdapter&lt;UserItem&gt;(this, UserItem.class, R.layout.user_item, query) {
          @Override
          protected void populateView(View v, UserItem userItem) {
              ((TextView)v.findViewById(android.R.id.text1)).setText(userItem.getUser_name());
          }
      };
      userListView.setAdapter(firebaseListAdapter);
  
  
      userSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
  
          @Override
          public boolean onQueryTextSubmit(String inputQuery) {
              currentEnteredQuery = inputQuery;
              return true;
          }
  
          @Override
          public boolean onQueryTextChange(String newText) {
              return false;
          }
      });
  
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_search_user, menu);
      return true;
  }
  </code></pre>