You should hide the ImageView when the icon id is 0. Try this:
if (nyPils.getIkonId() == 0) {
imageView.setVisibility(View.GONE); // or View.INVISIBLE
} else {
imageView.setVisibility(View.VISIBLE);
imageView.setImageResource(nyPils.getIkonId());
}