|
|
@@ -32,6 +32,7 @@ import org.json.JSONObject;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -63,25 +64,41 @@ public class TrackingListFragment extends ListFragment {
|
|
|
JSONObject objrec =arrrecords.getJSONObject(i);
|
|
|
|
|
|
|
|
|
- String title = objrec.getString("title");
|
|
|
- String icon = objrec.getString("icon");
|
|
|
- String description = objrec.getString("description");
|
|
|
- String detail = objrec.getString("detail");
|
|
|
- String date = objrec.getString("date");
|
|
|
- String port = objrec.getString("port");
|
|
|
+// String title = objrec.getString("title");
|
|
|
+// String icon = objrec.getString("icon");
|
|
|
+// String description = objrec.getString("description");
|
|
|
+// String detail = objrec.getString("detail");
|
|
|
+// String date = objrec.getString("date");
|
|
|
+// String port = objrec.getString("port");
|
|
|
+//
|
|
|
+// int iconid = commonUtil.iconName2Rid(getContext(),icon);
|
|
|
+//
|
|
|
+//
|
|
|
+//// lastid = id;
|
|
|
+// Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+// map.put("title", title);
|
|
|
+// map.put("icon", iconid);
|
|
|
+// map.put("description", description);
|
|
|
+// map.put("detail", detail);
|
|
|
+// map.put("date", date);
|
|
|
+// map.put("port", port);
|
|
|
|
|
|
- int iconid = commonUtil.iconName2Rid(getContext(),icon);
|
|
|
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
+ Iterator<String> keys = objrec.keys();
|
|
|
+ while (keys.hasNext()) {
|
|
|
+ String key = keys.next();
|
|
|
+ Object value = objrec.get(key);
|
|
|
+
|
|
|
+ if (key.equals("icon")) {
|
|
|
+ int iconid = commonUtil.iconName2Rid(getContext(),(String)value);
|
|
|
+ value = iconid;
|
|
|
+ }
|
|
|
+ map.put(key, value);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
-// lastid = id;
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("title", title);
|
|
|
- map.put("icon", iconid);
|
|
|
- map.put("description", description);
|
|
|
- map.put("detail", detail);
|
|
|
- map.put("date", date);
|
|
|
- map.put("port", port);
|
|
|
datalist.add(map);
|
|
|
|
|
|
}
|