Remove exception throw when a view has a self dependency inside a

RelativeLayout.

There are unfortunately successful 3rd party apps declaring self dependencies.
There's no reason to crash the app so just ignore this issue.
This commit is contained in:
Romain Guy
2009-07-19 19:47:42 -07:00
parent aad0fcc961
commit da3003e1d7

View File

@@ -1295,11 +1295,8 @@ public class RelativeLayout extends ViewGroup {
if (rule > 0) {
// The node this node depends on
final Node dependency = keyNodes.get(rule);
if (dependency == node) {
throw new IllegalStateException("A view cannot have a dependency" +
" on itself");
}
if (dependency == null) {
// Skip unknowns and self dependencies
if (dependency == null || dependency == node) {
continue;
}
// Add the current node as a dependent