Add item divider in RecyclerView (Android)

Here is the simplest way to add items dividers with Official Android Support library.

DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL);
yourRecyclerView.addItemDecoration(dividerItemDecoration);

Before android support library has this feature, adding recyclerview items divider is little bit painful. But now (Since Android Support Library version 25.0.0), with some line of code, you can get it easily.

References: