diff --git a/lib/src/main/java/com/wind/meditor/visitor/ModifyAttributeVisitor.java b/lib/src/main/java/com/wind/meditor/visitor/ModifyAttributeVisitor.java index 51b0e7b..d6d1da9 100644 --- a/lib/src/main/java/com/wind/meditor/visitor/ModifyAttributeVisitor.java +++ b/lib/src/main/java/com/wind/meditor/visitor/ModifyAttributeVisitor.java @@ -50,6 +50,9 @@ public class ModifyAttributeVisitor extends NodeVisitor { || (resourceId >= 0 && resourceId == attributeItem.getResourceId())) { hasBeenAddedAttributeList.add(attributeItem); newObj = attributeItem.getValue(); + if (obj != null && newObj != null && obj.getClass() != newObj.getClass()) { + type = attributeItem.getType(); + } break; } }