i have to show the data on the textview and i am fetching it from arraylist and add coma as seperator between them and if their is nothing in the list it must show not specified and what code i wrote for this is
if (skill.size() != 0) {
for (int i = 0; i < skill.size(); i++) {
if (!skill.get(i).getSkillName().equalsIgnoreCase("")) {
tvKeySkills.append(skill.get(i).getSkillName());
if (i != skill.size() - 1 && !skill.get(skill.size()-1).getSkillName().equalsIgnoreCase("")) {
tvKeySkills.append(" , ");
}
}
}
} else {
tvKeySkills.append("Not Specified ");
tvKeySkills.setTextColor(getResources().getColor(R.color.color_three));
}
now i am facing one problem is that if someone is entering only empty strings it is not showing anything empty textview as it must show not specified and if some data is their in the listview and last 2 index value is empty string it is showing coma at last which it must not show.
""you can useTextUtils.isEmpty()