I want my RecyclerView to scroll to the bottom when a new item is added to the list. Below is my code:
RecyclerView.LayoutManager layoutManager = new LinearL
ישו אוהב אותך's solution worked on other projects. But setting recyclerView.scrollToPosition() didn't work for me. This is what finally did the job:
public void addNewCard() {
data.add("New");
adapter.notifyItemInserted(data.size());
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.scrollTo(0,buttonAddNewItem.getTop());
}
});
}