kgehmlich / coen390-team-d

A heartrate monitoring app for firefighters
0 stars 0 forks source link

Toolbar Back button & Main Activity OnResume() #21

Closed Pierre-Lucas closed 7 years ago

Pierre-Lucas commented 7 years ago

When navigating back to the main activity using the Toolbar back button with the monitoring active, the UI of the Main Activity will reset to default values and nothing will update. Logcat shows that the monitoring is still happening in the background.

This also happens when the UI redraws on a screen rotation event

This does not happen when navigating back using the hardware back button.

Pierre-Lucas commented 7 years ago

These ressources may help

(Full of dark, unholy and forbidden solutions) http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android (Seems to have more "acceptable" solutions) http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html

Pierre-Lucas commented 7 years ago

Easiest "solution" so far seems to be to simply remove the Up navigation in the menu by removing parent attributes in Manifest and relying strictly on the Android navigation back button.

see fda69b3

Pierre-Lucas commented 7 years ago

Final solution is entirely done in Manifest. Parent attributes removed and orientation locked to Portrait mode.