I have an application that is running and doing some web services in the background.
When I rotate the screen I get a new instance of the application running. This is not the behavior that I want.
I know that in the onSaveInstanceState I can store a flag in the bundle and then look at the flag in the onCreate to see if a previous instance is running.
But I don't know what to do then to bring my ol开发者_JAVA百科d application in focus; back to the active app.
Help would be appreciated.
Add this in your manifest for the activity
android:configChanges="orientation"
This should ideally take care of it. You can also specify this to be a singleInstance application.
精彩评论