回答編集履歴
1
関数化した処理に上位のtry/catchを入れ忘れ。このように関数分割したことで同じ処理を2度書く必要があることがあるので注意が必要。
answer
CHANGED
@@ -93,18 +93,22 @@
|
|
93
93
|
}
|
94
94
|
}
|
95
95
|
|
96
|
-
private void moveCamera(){
|
96
|
+
private void moveCamera() {
|
97
|
+
try {
|
97
|
-
|
98
|
+
if (isJapan(location.getLatitude(), location.getLongitude())) {
|
98
|
-
|
99
|
+
// [国内]
|
99
|
-
|
100
|
+
mApplicationManager.getMap().clear();
|
100
|
-
|
101
|
+
mApplicationManager.getCommunication().executeByConcurrentExecutor();
|
101
|
-
|
102
|
+
// 現在位置に設定
|
102
|
-
|
103
|
+
LatLng currentLocation = new LatLng(location.getLatitude(), location.getLongitude());
|
103
|
-
|
104
|
+
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(currentLocation, 16.0f));
|
104
|
-
|
105
|
+
} else {
|
105
|
-
|
106
|
+
// [海外]
|
106
|
-
|
107
|
+
// 日本地図を表示
|
107
|
-
|
108
|
+
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(defaultLocation, DEFAULT_ZOOM));
|
109
|
+
}
|
110
|
+
} catch (SecurityException e) {
|
111
|
+
Log.e("Exception: %s", e.getMessage(), e);
|
108
112
|
}
|
109
113
|
}
|
110
114
|
```
|