Merge pull request 'GeoCoder.classへの遷移を後に変更' (#5) from CreateRoot2 into master
Reviewed-on: #5
This commit is contained in:
commit
c5d6e9ebc5
|
@ -2,28 +2,17 @@ package com.example.oplogy;
|
|||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.firebase.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
public class CreateRoot {
|
||||
private String address;
|
||||
private Timestamp startTimestamp;
|
||||
private Timestamp endTimestamp;
|
||||
private long studentNumber;
|
||||
private LatLng latLng;
|
||||
public void receiveData(List<MyDataClass> myDataList) {
|
||||
|
||||
// デバッグ用ログ
|
||||
for(MyDataClass data : myDataList){
|
||||
Log.d("CreateRoot", "data: "+ data.toString());
|
||||
}
|
||||
Log.d("CreateRoot", "myDataList[0]: " + myDataList.get(0).toString());
|
||||
|
||||
public void receiveData(String address, Timestamp startTimestamp, Timestamp endTimestamp, long studentNumber, LatLng latLng) {
|
||||
this.address = address;
|
||||
this.startTimestamp = startTimestamp;
|
||||
this.endTimestamp = endTimestamp;
|
||||
this.studentNumber = studentNumber;
|
||||
this.latLng = latLng;
|
||||
|
||||
// 受け取ったデータを利用してログを出力
|
||||
Log.d("CreateRoot", "address: " + address);
|
||||
Log.d("CreateRoot", "startTimestamp: " + startTimestamp);
|
||||
Log.d("CreateRoot", "endTimestamp: " + endTimestamp);
|
||||
Log.d("CreateRoot", "studentNumber: " + studentNumber);
|
||||
Log.d("CreateRoot", "latLng: " + latLng);
|
||||
}
|
||||
}
|
|
@ -58,10 +58,14 @@ public class FirestoreReception {
|
|||
//リストに追加
|
||||
myDataList.add(myData);
|
||||
}
|
||||
|
||||
|
||||
//取得したデータをログ表示
|
||||
for(MyDataClass data :myDataList){
|
||||
Log.i("FirestoreReceptiond", "data: " + data.toString());
|
||||
}
|
||||
CreateRoot createRoot=new CreateRoot();
|
||||
createRoot.receiveData(myDataList);
|
||||
} else {
|
||||
Log.w("FirestoreReceptiond", "Error getting documents.", task.getException());
|
||||
}
|
||||
|
|
|
@ -36,11 +36,6 @@ public class GeoCoder {
|
|||
Log.d("FirestoreReception", "studentNumber: " + studentNumber);
|
||||
Log.d("FirestoreReception", "latLng: "+latLng );
|
||||
|
||||
// CreateRootクラスのインスタンスを作成
|
||||
CreateRoot createRoot = new CreateRoot();
|
||||
// データを渡す
|
||||
createRoot.receiveData(address.get(0), firstDay.get(0), firstDay.get(1), studentNumber, latLng);
|
||||
|
||||
} catch (NullPointerException e) {
|
||||
Log.e("NullPointerException", "getの中身がnull" + e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user