'Android Why use executePendingBindings in RecyclerView

I have been using lately data bindings and i came across the executePendingBindings method. The documentation shows little much about it and i can't understand how it works or when to use it.

A lot of developers use the executePendingBindings inside the onBindViewHolder callback but i don't see any differences myself in recycler when using it or not.

Can someone explain why its important to use in recycler?? Thanks

    @Override
    public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {

            Customer customer= List.get(position).second;
            ((CustomerViewHolder)holder).binding.setCustomer (customer)

            ((CustomerViewHolder)holder).binding.executePendingBindings();


}


Solution 1:[1]

There is also a thing I should mention. When you call executePendingBindings() your list will not be as smooth as without this call. Because executePendingBindings() do the things in the UI thread. So imagine a list with 500 elements. And then, every time you call this method in the UI, You will get "The application may be doing too much work on its main thread".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marfin. F