diff --git a/packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java b/packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java index c3a50890456a4..ff70190241655 100644 --- a/packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java +++ b/packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java @@ -176,8 +176,11 @@ public class SettingsDrawerActivity extends Activity { @Override public void setContentView(@LayoutRes int layoutResID) { - LayoutInflater.from(this).inflate(layoutResID, - (ViewGroup) findViewById(R.id.content_frame)); + final ViewGroup parent = (ViewGroup) findViewById(R.id.content_frame); + if (parent != null) { + parent.removeAllViews(); + } + LayoutInflater.from(this).inflate(layoutResID, parent); } @Override