Domi04151309 / HomeApp

HomeApp is a small and easy to use smart home app with a simple framework.
https://f-droid.org/packages/io.github.domi04151309.home/
GNU General Public License v3.0
109 stars 24 forks source link

Reloading of device list #11

Closed P-a-t-r-i-c-k closed 4 years ago

P-a-t-r-i-c-k commented 4 years ago

The reloading of the device list depends on the variable reset. In the onStop state of main activity, this value was set to false. Consequently, after creating a new device or removing an existing device and returning to main screen resulted in an outdated device list.

Additionally, I moved the check from onStart to onResume to prevent a possible edge case if an activity is only paused instead of completely stopped.

Domi04151309 commented 4 years ago

Thanks for the improvement. I didn't notice that. Can you please revert the change from onStart to onResume because that edge case is never going to happen. By looking at the activity lifecycle definitions provided by Google you can see that the onResume state is for scenarios where other apps are in the foreground but the app is still visible. Because of performance concerns, it would be better to only call it when you actually return to the activity from another activity/app.

P-a-t-r-i-c-k commented 4 years ago

Fair point, didn't really consider the potential performance hit.