Fixed issue 307 by selecting Passive location provider in
DayNightHelper. Also added launcher for OsmAndMapCreator in eclipse
This commit is contained in:
parent
ee6d755d59
commit
96605b8cb2
2 changed files with 16 additions and 1 deletions
15
DataExtractionOSM/OsmAndMapCreator.launch
Normal file
15
DataExtractionOSM/OsmAndMapCreator.launch
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/DataExtractionOSM/src/net/osmand/swing/OsmExtractionUI.java"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="1"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||||
|
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||||
|
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.osmand.swing.OsmExtractionUI"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DataExtractionOSM"/>
|
||||||
|
</launchConfiguration>
|
|
@ -83,7 +83,7 @@ public class DayNightHelper implements SensorEventListener {
|
||||||
try {
|
try {
|
||||||
LocationManager locationProvider = (LocationManager) osmandApplication.getSystemService(Context.LOCATION_SERVICE);
|
LocationManager locationProvider = (LocationManager) osmandApplication.getSystemService(Context.LOCATION_SERVICE);
|
||||||
// Or use LocationManager.GPS_PROVIDER
|
// Or use LocationManager.GPS_PROVIDER
|
||||||
Location lastKnownLocation = locationProvider.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
|
Location lastKnownLocation = locationProvider.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
|
||||||
if(lastKnownLocation == null){
|
if(lastKnownLocation == null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue