Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings: Fix inflate exception on search. Dynamically replace nested…
… fragment. When PrivacyGuard is opened, the parent fragment would inflate the layout which contained a nested fragment. This is bad behavior. Since we couldn't keep track of the fragments lifecycle, the fragment we instantiated during inflation would cause an inflate exception if and when we toggled the search view within the current context. Mitigate the crash by programmatically replacing the fragment after instantiating it once. AndroidRuntime E FATAL EXCEPTION: main E Process: com.android.settings, PID: 12372 E android.view.InflateException: Binary XML file line SlimRoms#21: Error inflating class fragment E at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763) E at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) E at android.view.LayoutInflater.inflate(LayoutInflater.java:504) ... E Caused by: java.lang.IllegalArgumentException: Binary XML file line SlimRoms#21: Duplicate id 0x7f1001a2, tag nul l, or parent id 0xffffffff with another fragment for com.android.settings.privacyguard.PrivacyGuardPrefs E at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2120) E at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:177) E at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733) E ... 25 more Change-Id: I6820ad7d35814f150eedf91140e21c0b8e23322b
- Loading branch information