回答編集履歴
1
関数化した処理に上位のtry/catchを入れ忘れ。このように関数分割したことで同じ処理を2度書く必要があることがあるので注意が必要。
test
CHANGED
@@ -188,29 +188,37 @@
|
|
188
188
|
|
189
189
|
|
190
190
|
|
191
|
-
private void moveCamera(){
|
191
|
+
private void moveCamera() {
|
192
|
+
|
192
|
-
|
193
|
+
try {
|
194
|
+
|
193
|
-
if (isJapan(location.getLatitude(), location.getLongitude())) {
|
195
|
+
if (isJapan(location.getLatitude(), location.getLongitude())) {
|
194
|
-
|
196
|
+
|
195
|
-
// [国内]
|
197
|
+
// [国内]
|
196
|
-
|
198
|
+
|
197
|
-
mApplicationManager.getMap().clear();
|
199
|
+
mApplicationManager.getMap().clear();
|
198
|
-
|
200
|
+
|
199
|
-
mApplicationManager.getCommunication().executeByConcurrentExecutor();
|
201
|
+
mApplicationManager.getCommunication().executeByConcurrentExecutor();
|
200
|
-
|
202
|
+
|
201
|
-
// 現在位置に設定
|
203
|
+
// 現在位置に設定
|
202
|
-
|
204
|
+
|
203
|
-
LatLng currentLocation = new LatLng(location.getLatitude(), location.getLongitude());
|
205
|
+
LatLng currentLocation = new LatLng(location.getLatitude(), location.getLongitude());
|
204
|
-
|
206
|
+
|
205
|
-
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(currentLocation, 16.0f));
|
207
|
+
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(currentLocation, 16.0f));
|
206
|
-
|
208
|
+
|
207
|
-
} else {
|
209
|
+
} else {
|
208
|
-
|
210
|
+
|
209
|
-
// [海外]
|
211
|
+
// [海外]
|
210
|
-
|
212
|
+
|
211
|
-
// 日本地図を表示
|
213
|
+
// 日本地図を表示
|
212
|
-
|
214
|
+
|
213
|
-
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(defaultLocation, DEFAULT_ZOOM));
|
215
|
+
mApplicationManager.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(defaultLocation, DEFAULT_ZOOM));
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
} catch (SecurityException e) {
|
220
|
+
|
221
|
+
Log.e("Exception: %s", e.getMessage(), e);
|
214
222
|
|
215
223
|
}
|
216
224
|
|