RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(null);
recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
clientListAdapter = new ClientListAdapter(getActivity(), healerArr);
clientListAdapter.setHasStableIds(true);
recyclerView.setAdapter(clientListAdapter);
в MianActivty после закрытия всплывающего окна и добавления данных в базу данных
HomeFragment homeFragment = new HomeFragment();
homeFragment.clientListAdapter.notifyItemInserted(db.getCHealersCount() - 1);
в моем адаптере есть
@Override
public long getItemId(int position) {
return position;
}
Я пробовал это. но это дает мгновение.
HomeFragment homeFragment = new HomeFragment();
homeFragment.clientListAdapter.notifyDataSetChanged();