use of be.brunoparmentier.openbikesharing.app.adapters.SearchStationAdapter in project OpenBikeSharing by bparmentier.
the class StationsListActivity method loadData.
private void loadData(String query) {
ArrayList<Station> queryStations = new ArrayList<>();
String[] columns = new String[] { "_id", "text" };
Object[] temp = new Object[] { 0, "default" };
MatrixCursor cursor = new MatrixCursor(columns);
if (stations != null) {
for (int i = 0; i < stations.size(); i++) {
Station station = stations.get(i);
if (station.getName().toLowerCase().contains(query.toLowerCase())) {
temp[0] = i;
temp[1] = station.getName();
cursor.addRow(temp);
queryStations.add(station);
}
}
}
searchView.setSuggestionsAdapter(new SearchStationAdapter(this, cursor, queryStations));
}
Aggregations