Fix crash

This commit is contained in:
Victor Shcherb 2015-04-08 17:01:42 +02:00
parent 0d407b9026
commit a1686afc24

View file

@ -118,6 +118,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
public boolean onMenuItemClick(MenuItem item) {
if (searchFilterLayout.getVisibility() == View.GONE) {
searchFilterLayout.setVisibility(View.VISIBLE);
searchFilter.requestFocus();
} else {
if(filter != null) {
searchFilter.setText(filter.getSavedFilterByName() == null ? "" :
@ -187,6 +188,8 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
setSupportProgressBarIndeterminateVisibility(false);
app = (OsmandApplication) getApplication();
amenityAdapter = new AmenityAdapter(new ArrayList<Amenity>());
setListAdapter(amenityAdapter);
searchFilterLayout = findViewById(R.id.SearchFilterLayout);
searchFilter = (EditText) findViewById(R.id.edit);
searchFilter.addTextChangedListener(new TextWatcher() {
@ -211,8 +214,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
}
}
});
amenityAdapter = new AmenityAdapter(new ArrayList<Amenity>());
setListAdapter(amenityAdapter);
}