Closed smithe0 closed 9 years ago
Okay so I know how I'm going to fix all of this. It will be my next task. It will also create a little more reliability in basically all aspects of the program.
The issue is the way we start activities and that we never end them we just start another on top. This causes bugs doubly because we have an independent user list in each activity rather than accessing a user list through a singleton.
My solution is modifying our activity structure and creating a user controller singleton through which we access certain unique objects like userlist.
I finished this enhancement. The app now works smoothly in a more tree like fashion with the back button working as expected and the activities updating properly. Also there are no longer a ton of open activities.
Main Issue
Right now the back button on the phone brings you back along the stack to the activity you were most recently on beforehand. This should actually bring you to the parent activity higher up in the chain towards your user's home screen so you don't have to unravel back through every activity you've ever visited.
Extra notes:
I'm also slightly worried about how we are implementing activities, it depends how the default implementation of the back button works, but I think this unwinding behavior is indicative of us having a new instance of each activity whenever we navigate to it. If I add a friend to a user it successfully adds it to that user's friend list and then navigates you to a UserFriends activity showing the newly added friend, but if you press the back button twice bring you back to UserFriends activity that you added the friend from it doesn't show the newly added friend. Anyways even if we do fix the back button I'm worried that we will run into memory leaks here.