title: Search SQLite database returns empty cursor
body: <p>I am using a searchView to get a query to search database with a string,  the Cursor does not return as null but is empty.</p>
  
  <p>The call to search from my search activity (which is a ListActivity implementing SearchView.OnQueryTextListener):</p>
  
  <pre><code>@Override
      public boolean onQueryTextChange(String newText) {
          // TODO Auto-generated method stub
          //handleIntent(intent);
          Log.d("LIST ACTIVITY SEARCH", "onQueryTextCahanged called: "+ newText);
          Cursor c = data.getWordMatches(newText, null);
  
          Log.d("LISTACTIVITY", "CURSOR QUERY ROWS/COLS = "+ c.getCount()+" "+c.getColumnCount());
  
          //now set bind cursor data to list view using custim ItemAdpter class
          adapter = new ItemAdapter(ViewListOfTests.this, c);
          this.setListAdapter(adapter);
          return false;
      }
  </code></pre>
  
  <p>And the search method in SQLite Databasetaking the String query from method above:</p>
  
  <pre><code>/*
       * methods to search database with String query form searchable widget intent 
      *  in ViewListOfDives ListActivity search bar. Each search returns a cursor which is set to adpter
      *  in ViewListOfYesys List Activity
      */
  
      public Cursor getWordMatches(String query, String[] columns){
  
          String selection = database.KEY_TESTNAME + " MATCH ?";
          String[] selectionArgs = new String[] {query+"*"}; //wildcard *
  
          return query(selection, selectionArgs, columns);
  
  
      }//end getWordMatches
  
  
  
      private Cursor query(String selection, String[] selectionArgs,
              String[] columns) {
  
          // return cursor form params passed getWordMatches(Styring query) from search widget ListActivity
  
          SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
          builder.setTables(DATABASE_TABLE);
  
          dbHelperObject = new DbHelper(ourContext);
  
          Cursor cursor = builder.query(dbHelperObject.getReadableDatabase(), columns, selection, selectionArgs, null, null, null);
  
          if(cursor == null){
              return null;
          }else if(!cursor.moveToFirst()){
              cursor.close();
              return null;
          }
  
          return cursor;
  
  
  
  
      }//end query
  </code></pre>
  
  <p>The else if code executes here returning an empty cursor :</p>
  
  <pre><code>else if(!cursor.moveToFirst()){
                  cursor.close();
                  return null;
  </code></pre>
  
  <p>Any input appreciated! 
  Ciaran</p>