private void retrieveTracks(SearchQuery query,ArrayList<Track> tracks){
  String queryLikeSelection="%" + query.textQuery + "%";
  String[] trackSelectionArgs=new String[]{queryLikeSelection,queryLikeSelection,queryLikeSelection};
  Cursor cursor=null;
  try {
    cursor=providerUtils.getTrackCursor(TRACK_SELECTION_QUERY,trackSelectionArgs,TRACK_SELECTION_ORDER);
    if (cursor != null) {
      tracks.ensureCapacity(cursor.getCount());
      while (cursor.moveToNext()) {
        tracks.add(providerUtils.createTrack(cursor));
      }
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

private void retrieveTracks ( SearchQuery query , ArrayList < Track > tracks ) { String queryLikeSelection = "%" + query . textQuery + "%" ; String [ ] trackSelectionArgs = new String [ ] { queryLikeSelection , queryLikeSelection , queryLikeSelection } ; Cursor cursor = null ; try { cursor = providerUtils . getTrackCursor ( TRACK_SELECTION_QUERY , trackSelectionArgs , TRACK_SELECTION_ORDER ) ; if ( cursor != null ) { tracks . ensureCapacity ( cursor . getCount ( ) ) ; while ( cursor . moveToNext ( ) ) { tracks . add ( providerUtils . createTrack ( cursor ) ) ; } } } finally { if ( cursor != null ) { cursor . close ( ) ; } } }
retrieves tracks matching the given query from the database .
