In my App the main `Activity` instantiates another class that implements `LocationListener` (let's it `GeolocationManager`).
The reference to the main Activity is passed into the `GeolocationManager`'s constructor.

Inside the `GeolocationManager` an algorithm gets executed according to the received locations and the UI of the main activity gets updated accordingly.

For example:

`mainActivityReference.findViewById..` --> change the style of an element..

Problems arise when i press the Android "back" button. The `GeolocationManager` keeps working (and that's nice) but when i re-open the activity (that in the meantime has been destroyed) the `GeolocationManager` it's no longer able to perform changes in the UI of the main `Activity`.

The code gets executed, but no changes are visible on the UI. When a new location gets detected, the `GeolocationManager` also tries to scroll the main activity (it contains a `ScrollView`) to a specific position. Even in this case, the code gets executed but the activity does not scroll.

I think that it is all related to the fact that after restoring the `Activity`, also the `GeolocationManager` gets created again even if it is already running in background and something gets corrupted.

Why is this happening?