use of de.bahnhoefe.deutschlands.bahnhofsfotos.model.UpdatePolicy in project RSAndroidApp by RailwayStations.
the class MainActivity method onCreateOptionsMenu.
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
final SearchManager manager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
final MenuItem searchMenu = menu.findItem(R.id.search);
final SearchView search = (SearchView) searchMenu.getActionView();
search.setSearchableInfo(manager.getSearchableInfo(getComponentName()));
search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(final String s) {
Log.d(TAG, "onQueryTextSubmit: " + s);
searchString = s;
updateStationList();
return false;
}
@Override
public boolean onQueryTextChange(final String s) {
Log.d(TAG, "onQueryTextChange: " + s);
searchString = s;
updateStationList();
return false;
}
});
final UpdatePolicy updatePolicy = baseApplication.getUpdatePolicy();
menu.findItem(updatePolicy.getId()).setChecked(true);
return true;
}
Aggregations