关于从 mysql db 检索数据,我需要您的帮助。我无法将字符串添加到数组列表。我的清单声明
ArrayList<HandleListReport> reportList = new ArrayList<HandleListReport>();
这是我的代码
report_data = json.getJSONArray(TAG_REPORT_DATA);
for (int i = 0; i < report_data.length(); i++) {
//storing variable
JSONObject c = report_data.getJSONObject(i);
String reportID = c.getString(TAG_REPORT_ID);
String userID = c.getString(TAG_UID);
String projectName = c.getString(TAG_PROJECT_NAME);
String localWork = c.getString(TAG_LOCATION);
String timeStart = c.getString(TAG_TIME_START);
String timeEnd = c.getString(TAG_TIME_END);
Log.d(TAG_LOCATION, localWork);
// add data to Arraylist
reportList.add(new HandleListReport(reportID, userID, projectName, localWork, timeStart, timeEnd));
我的问题我的 listReport 缺少字符串数据。Logcat 显示报告列表 ---> []
感谢您的回答!