I added a few lines in createActivity and ActivityDetails to add the activity to the profile of the user when he enrolls or creates an activity. To do so, I wrote a function addActivity in the profileViewModel, and in the ProfileRepositoryFirestore that adds an activity to the profile's list of activities in the database. I changed the signature of these functions to add a profileViewModel, and I changed the MainActivity and the test File to call the changed files while giving this added parameter.
I added a few lines in createActivity and ActivityDetails to add the activity to the profile of the user when he enrolls or creates an activity. To do so, I wrote a function addActivity in the profileViewModel, and in the ProfileRepositoryFirestore that adds an activity to the profile's list of activities in the database. I changed the signature of these functions to add a profileViewModel, and I changed the MainActivity and the test File to call the changed files while giving this added parameter.