I have this code.
for (j=0; j<st.length; j++)
{ Log.d("MY LOGGGGS", "Цикл "+j);
if (st[j]==compdate)
{ Log.d("MY LOGGGGS", "Даты совпали");}
else
{ Log.d("MY LOGGGGS", "Даты не равны:"+compdate+"===="+st[j]+"=");}}
And that's what my logs are showing.
As you can see, the string values in "st" are the same as the value in "compdate", but "if" doesn't work right. No excess spaces. The same thing happens when I'm converting these values to date and try to compare. What can I do wrong?
P.S. st is {"2014-03-16","2014-03-16"};
compdate is currentdate;
String compdate=(String) DateFormat.format("yyyy-MM-dd",new Date());