diff --git a/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java b/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java index 911ee68..851eee6 100644 --- a/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java +++ b/app/src/main/java/com/example/cosmosclient/services/CosomosBackgroundService.java @@ -55,6 +55,7 @@ private static final int MinTime = 1000;/*最小時間間隔*/ private static final float MinDistance = 1;/*最小距離間隔*/ private int count = 0; + private int areacount= 0; public CosomosBackgroundService() { super("CosomosBackgroundService"); @@ -169,7 +170,7 @@ } @Override - public void onLocationChanged(Location location) { + public void onLocationChanged(final Location location) { // Log.d("debug", "onLocationChanged"); Log.d("debug", "lat:" + location.getLatitude()); Log.d("debug", "lon:" + location.getLongitude()); @@ -208,10 +209,12 @@ public void onResponse(Call> call, Response> response) { if (response.isSuccessful()) { ArrayList result = response.body(); + AreaInformation areaList = new AreaInformation(); + CosmosLocation areaInfo = new CosmosLocation(); //app/Cosmosに情報保存 Cosmos app = (Cosmos) getApplication(); -// app.setAreaInfo(); + app.getAreaInfo(areacount).setLocation(areaInfo); } else { //onFailureでキャッチできないエラー用