If I have my app into background mode and then navigate to general settings to change permission of my app (like changing location mode permission) then when I go back to the app onCreate() method is triggered. I need to preserve the objects instantiated before app background mode. After onStop() (when goes in background mode) the activity should call onResume(), but I haven't got that behavior from Activity. Thanks in advance!
If I have my app into background mode and then navigate to general settings to change permission of my app (like changing location mode permission) then when I go back to the app onCreate() method is triggered.
In general, when your app is in the background, your process can be terminated at any time, for any reason.
Specifically with respect to permissions, if your app is in the background and the user revokes permissions in Settings, your process is terminated, so you will re-check to see if you hold those permissions if/when the user returns to your app.
I need to preserve the objects instantiated before app background mode
That is not strictly possible. If your process is terminated, the objects in memory go away. You can use the saved instance state Bundle
or your own persistent data stores (e.g., a file) to help with this.