This is my code, it always falls into the else even when I know that the value going in (via debugger) is emtpy.
name = cursor.getString(cursor.getColumnIndex("Genus")) + " " + cursor.getString(cursor.getColumnIndex("Species"));
if(name != "" && name != null)
tv.setText(name);
else
tv.setText("Error");