我在我的android项目中使用simplexml,一切正常,直到我混淆代码.然后,错误开始涌入.
部分XML如下:
<categories success="true">
<category id="102" caption="Magazin" parent="0" num_mags="114" >
<category id="15" caption="Kunst" parent="102" num_mags="13" >
<category id="17" caption="Design" parent="15" num_mags="10" ></category>
<category id="18" caption="Haute+Couture" parent="15" num_mags="2" >
...
Run Code Online (Sandbox Code Playgroud)
我有两个类:CategoryItemList:
@Root(name = "categories")
public class CategoryItemList {
private final List<CategoryItem> mCategoryItems;
/**
* Create a new category items list.
*
* @param categoryItems the list of category items
*/
public CategoryItemList(@ElementList(name = "category", inline = true) final List<CategoryItem> categoryItems) {
mCategoryItems = categoryItems;
}
@ElementList(name = "category", inline = true) …
Run Code Online (Sandbox Code Playgroud)