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)

```
Well, after some mistakes I finally got what I needed! I changed some strings in my ViewModel from:

```
    for (IssueViewResponse.MessageItem message : response.getMessages()) {
            this.messages.add(new MessageItem(message));
}

```

to:

```
for (IssueViewResponse.MessageItem message : response.getMessages()) {
            if (!TextUtils.isEmpty(message.getText())) {
                this.messages.add(new MessageItem(message));
            }
        }

```

Thank you guys!