Domanda

I'm loading an external XML similar to this:

<list>
    <item>test</item>
    <item>test</item>
    <item>test</item>
    <summary>3</summary>
</list>

How can I annotate a private List<String> items; field so that the Simple framework deserializes the three item tags but not the summary tag?

È stato utile?

Soluzione

This worked:

@ElementList(inline = true, name = "item")
private List<String> items;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top