im having great difficulties with this. I made a Gridview with a CalendarView which in each position has a date assigned.i iterate it with this code..
for (int n = 0; n < mnthlength; n++) {
itemvalue = df.format(pmonthmaxset.getTime());
Log.v("Calendar","look at this----->"+itemvalue);
pmonthmaxset.add(GregorianCalendar.DATE, 1);
day_string.add(itemvalue);
}
i have another code for a method that returns another arraylist...
private List<ParseObject>getEventListFromParse(){
ParseQuery<ParseObject> query = ParseQuery.getQuery("Event");
query.whereEqualTo("Comercial", ParseUser.getCurrentUser().getObjectId());
query.include("Fecha");
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
for (ParseObject obj:objects
) {
eventArraylist=new ArrayList<>();
eventArraylist.add(obj);
}
} else {
Log.d("score", "Error: " + e.getMessage());
}
}
});
return eventArraylist;
}
so we now have
List<String> day_string;
and
List<ParseObject> eventArraylist;
This both have elements presented like string yyyy-mm-dd. i need to the comparison to loop though each position starting from 0 and tell me if in the first element of day_string (For example is today 2019-03-20) if there is a matching date on the eventArraylist.
i checked some stack post but could implement them. How to compare two types of arraylist in android