Fix exception

This commit is contained in:
Victor Shcherb 2013-02-08 19:53:56 +01:00
parent ceded9c1fa
commit 3cd5fac71c
6 changed files with 26 additions and 16 deletions

View file

@ -398,7 +398,9 @@ public class ResourceManager {
file.mkdirs(); file.mkdirs();
List<String> warnings = new ArrayList<String>(); List<String> warnings = new ArrayList<String>();
if (file.exists() && file.canRead()) { if (file.exists() && file.canRead()) {
for (File f : file.listFiles()) { File[] lf = file.listFiles();
if (lf != null) {
for (File f : lf) {
if (f.isDirectory()) { if (f.isDirectory()) {
File conf = new File(f, "_config.p"); File conf = new File(f, "_config.p");
if (!conf.exists()) { if (!conf.exists()) {
@ -410,6 +412,7 @@ public class ResourceManager {
} }
} }
} }
}
return warnings; return warnings;
} }

View file

@ -411,11 +411,14 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
} }
} }
} }
for (IndexItem file : downloadListIndexThread.getCachedIndexFiles()) { List<IndexItem> cachedIndexFiles = downloadListIndexThread.getCachedIndexFiles();
if (cachedIndexFiles != null) {
for (IndexItem file : cachedIndexFiles) {
if (file.getType() == type) { if (file.getType() == type) {
filtered.add(file); filtered.add(file);
} }
} }
}
return filtered; return filtered;
} }

View file

@ -1238,7 +1238,9 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|| settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS ? OsmandSettings.BOTTOM_CONSTANT : || settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS ? OsmandSettings.BOTTOM_CONSTANT :
OsmandSettings.CENTER_CONSTANT); OsmandSettings.CENTER_CONSTANT);
registerUnregisterSensor(getLastKnownLocation(), false); registerUnregisterSensor(getLastKnownLocation(), false);
if (mapLayers.getMapInfoLayer() != null) {
mapLayers.getMapInfoLayer().recreateControls(); mapLayers.getMapInfoLayer().recreateControls();
}
mapLayers.updateLayers(mapView); mapLayers.updateLayers(mapView);
getMyApplication().getDaynightHelper().setDayNightMode(settings.DAYNIGHT_MODE.get()); getMyApplication().getDaynightHelper().setDayNightMode(settings.DAYNIGHT_MODE.get());

View file

@ -41,7 +41,7 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity<B
setLabelText(R.string.incremental_search_building); setLabelText(R.string.incremental_search_building);
progress.setVisibility(View.INVISIBLE); progress.setVisibility(View.INVISIBLE);
finishInitializing(result); finishInitializing(result);
if (result.isEmpty()) { if (result == null || result.isEmpty()) {
Toast.makeText(SearchBuildingByNameActivity.this, Toast.makeText(SearchBuildingByNameActivity.this,
R.string.no_buildings_found, Toast.LENGTH_LONG).show(); R.string.no_buildings_found, Toast.LENGTH_LONG).show();
} }

View file

@ -587,8 +587,9 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
mediaRec.release(); mediaRec.release();
mediaRec = null; mediaRec = null;
} }
if (recordControl != null) {
setRecordListener(recordControl, mapActivity); setRecordListener(recordControl, mapActivity);
app.getSettings().SHOW_RECORDINGS.set(true); }
} }
@ -739,6 +740,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
par.removeView(recordControl); par.removeView(recordControl);
} }
stopRecording(mapActivity); stopRecording(mapActivity);
app.getSettings().SHOW_RECORDINGS.set(true);
indexFile(f); indexFile(f);
mapActivity.getMapView().refreshMap(); mapActivity.getMapView().refreshMap();
} }

View file

@ -209,7 +209,7 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
} }
public synchronized void removeLayer(OsmandMapLayer layer) { public synchronized void removeLayer(OsmandMapLayer layer) {
layers.remove(layer); while(layers.remove(layer));
zOrders.remove(layer); zOrders.remove(layer);
layer.destroyLayer(); layer.destroyLayer();
} }