Reputation: 171
I have an app that produces a notification when a process completes. Upon clicking on the notification, a popup is created. The popup is essentially an activity that isn't full screen.
My issue is that if this popup is created on top of an open application, when the screen orientation changes, the background application is killed. I have attempted to circumvent this by forcing portrait mode (in the manifest and code) but that kills the background app as well when closing out of the popup.
Does anyone know how to accomplish this without killing the background app when the configuration changes?
Upvotes: 0
Views: 291
Reputation: 50538
Add these lines in your manifest
<activity android:name=".Activity"
android:configChanges="keyboardHidden|orientation"
android:label="@string/app_name">
then implement in your java code this override method
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);}
With this you are telling your application to do nothing when config changes occur (orientation changes let's say) I had the same problem. The whole activity was restarted, adding this, solved this issue. I hope it does work for you too.
Upvotes: 1