For previous versions of the SDK these lines in the AndroidManifest.xml file were enough to avoid orientation changes and activity resets:
android:launchMode=