I'm trying to do a simple IF check of a String that I know has been formatted correctly with:
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String formattedDate = df.format(c.getTime());
At this point formattedDate is "09/24/2015". I can confirm that this is true:
remoteViews.setTextViewText( R.id.widget_date, formattedDate);
It's showing me the correct date. So I know it's good. So I test it:
if (formattedDate=="09/24/2015"){
//do some stuff
}
For whatever reason, that condition is not true, and nothing happens. I have tried everything from removing the slashes, to just changing the format around, but formattedDate never equals what that string clearly is.
Is there something I'm missing here?