Commit 309aa3e
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: I6820ad7d35814f150eedf91140e21c0b8e23322b1 parent 354d52c commit 309aa3e
File tree
3 files changed
+17
-18
lines changed- res/layout
- src/com/android/settings/privacyguard
3 files changed
+17
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | | - | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | | - | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
25 | 22 | | |
26 | 23 | | |
27 | | - | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
| |||
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments