有没有简单的方法,在Android的一个属性对象的JSONArray排序? [英] Is there any easy way to sort a JSONArray of objects by an attribute in Android?
本文介绍了有没有简单的方法,在Android的一个属性对象的JSONArray排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有简单的方法,在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-藏品的例子
这篇关于有没有简单的方法,在Android的一个属性对象的JSONArray排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文