最初にJSON配列「日付」をarratstringに保存し、一致する場合は日付をリストと照合し、この行の後にその日付の「タイトル」名を表示します if (Vacation_Date.contains(mydate)) {
その日付のタイトル名と一致する値のみをテキストビューに出力したいのですが、どうすればよいでしょうか
static ArrayList<Long> Vacation_ID = new ArrayList<Long>();
static ArrayList<String> Vacation_name = new ArrayList<String>();
static ArrayList<String> Vacation_Date = new ArrayList<String>();
JSONObject json3 = new JSONObject(str2);
status = json3.getString("status");
if (status.equals("1")) {
JSONArray school = json3.getJSONArray("data");
for (int k = 0; k < school.length(); k++) {
JSONObject jb = (JSONObject) school.getJSONObject(k);
Vacation_ID.add((long) k);
Vacation_Date.add(jb.getString("date"));
}
}
のjsonファイルからの強力な配列「日付」Vacation_Date
。今、私の日付を Vacation_Date と比較し、Vacation_Date に存在するかどうかを確認し、そのタイトル名を textview に表示します。
if (Vacation_Date.contains(mydate))
//試合日のタイトル名を表示するために何をするか
textview.settext ("title name of match date")'
}
JSON
{"status":1,
"data":
[
{"id":"1",
"title":"abc",
"date":"2013-09-29"},
{"id":"2",
"title":"abc1",
"date":"2013-09-25"},
{"id":"3",
"title":"abc",
"date":"2013-10-05"},
{"id":"4",
"title":"abc1",
"date":"2013-09-27"}
]
}