Fix exceptions

This commit is contained in:
Victor Shcherb 2013-08-04 13:50:18 +02:00
parent 2ff8ff8230
commit 0eb598d815
5 changed files with 21 additions and 10 deletions

View file

@ -67,13 +67,17 @@ public class EditPOIFilterActivity extends OsmandListActivity {
filter = helper.getFilterById(filterId);
super.onCreate(icicle);
setContentView(R.layout.editing_poi_filter);
getSupportActionBar().setTitle(R.string.filterpoi_activity);
getSupportActionBar().setIcon(R.drawable.tab_search_poi_icon);
if (filter != null) {
getSupportActionBar().setSubtitle(filter.getName());
setListAdapter(new AmenityAdapter(AmenityType.getCategories()));
} else {
setListAdapter(new AmenityAdapter(new AmenityType[0]));
}
}
@ -94,6 +98,9 @@ public class EditPOIFilterActivity extends OsmandListActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if(filter == null) {
return super.onCreateOptionsMenu(menu);
}
createMenuItem(menu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item,
R.drawable.ic_action_gsave_light, R.drawable.ic_action_gsave_dark ,
MenuItem.SHOW_AS_ACTION_IF_ROOM);

View file

@ -81,8 +81,8 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
itemsValues.add(AV_CAMERA_FOCUS_CONTINUOUS);
}
}
entries = items.toArray(entries);
intValues = itemsValues.toArray(intValues);
entries = items.toArray(new String[items.size()]);
intValues = itemsValues.toArray(new Integer[itemsValues.size()]);
if (entries.length > 0) {
ListPreference camFocus = createListPreference(p.AV_CAMERA_FOCUS_TYPE, entries, intValues, R.string.av_camera_focus,
R.string.av_camera_focus_descr);

View file

@ -259,7 +259,9 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
}
app.showShortToastMessage(resId);
updateSettings();
if(mapView != null) {
mapView.refreshMap();
}
}
}

View file

@ -443,6 +443,8 @@ public class ResourceManager {
context.getSettings().PREVIOUS_INSTALLED_VERSION.set(Version.getFullVersion(context));
context.getPoiFilters().updateFilters(false);
} catch (SQLiteException e) {
log.error(e.getMessage(), e);
} catch (IOException e) {
log.error(e.getMessage(), e);
} catch (XmlPullParserException e) {