diff options
| author | 2016-10-05 13:13:21 -0700 | |
|---|---|---|
| committer | 2016-10-05 13:44:36 -0700 | |
| commit | d7dbec7e4cce88fb428a2400fa468ad3b2a3962f (patch) | |
| tree | 5d8012e205d386c7430c9a7c968146d33966e8e2 | |
| parent | d5aa6361d97a8a5167c14823d42e1554607e527f (diff) | |
When adding dialog window but not creating update the configuration.
When we dismiss the dialog as opposed to hide it, it is removed
from the local WindowManagerGlobal's list of ViewRoots. Thus it stops
receiving configuration changes. When first adding a ViewRoot it will
pull the configuration from the context, but in this case
we are reusing one which has already been added and removed
and no such action will occur.
Bug: 31004614
Change-Id: Ie247bcf1a14caf4a42413c6813e337aa4c88e3e4
| -rw-r--r-- | core/java/android/app/Dialog.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 85a0403fe57e..6e2c464e9a37 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -32,6 +32,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.ContextWrapper; import android.content.DialogInterface; +import android.content.res.Configuration; import android.content.pm.ApplicationInfo; import android.graphics.drawable.Drawable; import android.net.Uri; @@ -288,9 +289,14 @@ public class Dialog implements DialogInterface, Window.Callback, } mCanceled = false; - + if (!mCreated) { dispatchOnCreate(null); + } else { + // Fill the DecorView in on any configuration changes that + // may have occured while it was removed from the WindowManager. + final Configuration config = mContext.getResources().getConfiguration(); + mWindow.getDecorView().dispatchConfigurationChanged(config); } onStart(); |