Skip to content

Commit d2aed5a

Browse files
committed
Fix fatal bug
1 parent 83d1271 commit d2aed5a

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ dependencies {
2525

2626
android {
2727
defaultConfig {
28-
versionCode 20
29-
versionName "2.4.0"
28+
versionCode 21
29+
versionName "2.5.0"
3030
}
3131

3232
compileSdkVersion 21

res/drawable-hdpi/ic_launcher.png

-1.64 KB
Loading

res/drawable-mdpi/ic_launcher.png

-995 Bytes
Loading

res/drawable-xhdpi/ic_launcher.png

-2.5 KB
Loading
-4.28 KB
Loading
2.61 KB
Loading

src/com/tbilisi/bus/MainActivity.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ private void setUpMap() {
5858
googleMap.setTrafficEnabled(false);
5959
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
6060
Criteria criteria = new Criteria();
61-
String provider = locationManager.getBestProvider(criteria, false);
61+
String provider = locationManager.getBestProvider(criteria, true);
6262
Location myLocation = null;
63-
double latitude, longitude;
64-
int zoomLevel;
63+
64+
//Default location and zoom level (Tbilisi)
65+
double latitude = 41.7167f;
66+
double longitude = 44.7833f;
67+
int zoomLevel = 11;
68+
6569
if(provider != null) {
6670
myLocation = locationManager.getLastKnownLocation(provider);
67-
}
68-
if(myLocation != null) {
69-
latitude = myLocation.getLatitude();
70-
longitude = myLocation.getLongitude();
71-
zoomLevel = 17;
72-
} else {
73-
latitude = 41.7167f;
74-
longitude = 44.7833f;
75-
zoomLevel = 11;
71+
if(myLocation != null) {
72+
latitude = myLocation.getLatitude();
73+
longitude = myLocation.getLongitude();
74+
zoomLevel = 17;
75+
}
7676
}
7777

7878
LatLng latLng = new LatLng(latitude, longitude);

0 commit comments

Comments
 (0)