Question: I have a RecyclerView and I need some `if statement` in my Adapter to make RecyclerView skip and do not create an item if one field in my ViewModel is empty. For example I have ViewModel with title and picture in it, so if the title is empty - do not create an item for it. So:

```
if (TextUtils.isEmpty(viewModel.getMessages().getTitle())) {
//do something?
}

```

This should be easy enough, but I just started practicing RecyclerView :)

Answer: 
If you need to remove item use

```
list.remove(position)
adapter.notifyItemRemoved(position)

```
check your list and if the current item is null or not. If it is, then remove the item from the list and call notifyDataSetChanged();

```
  if ((android.get(position).getname())==null) {
                         pos = android.get(position);
                         android.remove(pos);
                          notifyDataSetChanged();}

```