Markus Koiti
Markus Koiti

Reputation: 65

Why does my android app restarts when I put it out of the dockingstation?

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

Answers (1)

CommonsWare
CommonsWare

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

Related Questions