firestoreから送られてくるデータのmap化 #1
|
@ -7,6 +7,7 @@
|
||||||
<option name="testRunner" value="GRADLE" />
|
<option name="testRunner" value="GRADLE" />
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="jbr-17" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -19,6 +19,9 @@ public class FirestoreReception {
|
||||||
db = FirebaseFirestore.getInstance();
|
db = FirebaseFirestore.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//firestoreから受け取ったデータを束ねるためのマップ
|
||||||
|
public Map<String, Object> firestoreData;
|
||||||
|
|
||||||
//ClassIdを引数にデータの作成を行う
|
//ClassIdを引数にデータの作成を行う
|
||||||
public void getDocumentsByClassId(int classId, MainActivity context) {
|
public void getDocumentsByClassId(int classId, MainActivity context) {
|
||||||
CollectionReference collectionRef = db.collection("QuestionnaireForms");
|
CollectionReference collectionRef = db.collection("QuestionnaireForms");
|
||||||
|
@ -36,11 +39,17 @@ public class FirestoreReception {
|
||||||
// CreateRootクラスのインスタンスを作成し、dataを引数として渡す
|
// CreateRootクラスのインスタンスを作成し、dataを引数として渡す
|
||||||
GeoCoder geoCoder = new GeoCoder();
|
GeoCoder geoCoder = new GeoCoder();
|
||||||
geoCoder.processData(data, context);
|
geoCoder.processData(data, context);
|
||||||
|
|
||||||
|
// firestoreDataにdataを追加
|
||||||
|
firestoreData = data;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.w("FirestoreReception", "Error getting documents.", task.getException());
|
Log.w("FirestoreReception", "Error getting documents.", task.getException());
|
||||||
}
|
}
|
||||||
|
Log.w ("FirestoreReception", "firestoreData: " + firestoreData.size());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user