Reputation: 65
Hy I wrote my own Android App. My problem is, that it restarts everytime I put it out of my docking station. what can i do?
best regards markus
Upvotes: 1
Views: 548
Reputation: 1006944
My problem is, that it restarts everytime I put it out of my docking station
Putting a device in or out of supported car and desk docks results in a configuration change, the same as if the user rotates the screen, changes a locale, attaches a keyboard, etc.
So, your app does not restart, but your activity is destroyed and recreated, by default.
what can i do?
Support configuration changes, via onSaveInstanceState()
, retained fragments, etc.
Upvotes: 3