嗨,我正在对来自 web 服务的日期进行排序,即 json,我需要根据创建的日期对其进行排序。正常排序 Collections.sort 不起作用我需要在排序之前格式化日期如何做到这一点
CommunicationEngine.post(getApplicationContext(), "sports",
mylibraryRequest, new AsyncHttpResponseHandler() {
com.loopj.android.http.AsyncHttpResponseHandler#onStart()
com.loopj.android.http.AsyncHttpResponseHandler#onSuccess(java.lang.String)
@Override
ObjectMapper sportsMapper = new ObjectMapper();## Heading ##try {
SportsResponse sportsResponse = sportsMapper.readValue(sportsResponseASString,SportsResponse.class);
if (null != sportsResponse) {
List<Assets> assets = sportsResponse.getAssets();
(Assets asset : assets) {
//sort list
sort_sportList.add(asset.getTitle()
.trim());
if(asset.getSportType() != null){
sort_sport.add(asset.getSportType().trim()); } EGLibContent eglibitem = new EGLibContent(
.getAssetEventDate(),
adapter.getKey("Contents");
adapter.addeglibcontent(eglibitem,ListView);
我通常通过对 collections.sort() 进行排序来使用标题
我想对 getAssetEventDate() 进行排序。从 tthis 函数返回的值