有没有简单的方法,在Android的一个属性对象的JSONArray排序?属性、对象、简单、方法

2023-09-05 05:16:41 作者:♀瞳孔ヘ印温柔

有没有简单的方法,在Android的属性?

Is there any easy way to sort a JSONArray of objects by an attribute in Android?

推荐答案

也许使用谷歌GSON库,您可以deserialise数组对象的类型集合,然后使用类别进行排序。

Perhaps using the Google GSON library you can deserialise the array to a typed collection of objects, and then using Collections perform a sort.

看六号线在以下链接..看起来有点混乱,但可能是最快捷的方式。

Look at 6th line in on the following link.. Looks a bit messy but might be quickest way..

http://sites.google.com/网站/ GSON / GSON用户导向#TOC-藏品的例子

 
精彩推荐
图片推荐