I'm trying to write a program, that display list of movies that are aviliable in selected date in DatePicker. I'm adding movie showing date by another DatePicker, and it's working well(when i choose showing day, it saves, so I can see it again when i want to edit details). But I have a problem displaying titles by selected date. I was trying to do it by adding before setting titles in list, but it didn't seem to work. (showingDate is choosen date, and emissionDay is saved date for movies).
Can you help me, how I have to write part of code that check, if choosen and saved date are the same and show me right titles in list?
I don't know what kind of data you're trying to compare with that code, but you should normally use the == operator only to compare primitive values. To compare two objects for equality you should use the equals() method. Like this: