I have two fragments in an activity. RecordFragment records audio, RecordingsFragment displays all the record audio. My problem is how do I refresh RecyclerView of RecordingsFragment after I click stop button in RecordFragment.
This is code for adapter. Utils.getListOfNames() retrives list of files from storage.
mRecyclerView = rootView.findViewById(R.id.recyclerView);
mAdapter = new RecordingsListAdapter(Utils.getListOfNames(), getContext());
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
This is the onClick of stopButton
Toast.makeText(getContext(), "Stop clicked ", Toast.LENGTH_SHORT).show();
mediaRecorder.stop();
startButton.setVisibility(View.VISIBLE);
stopButton.setVisibility(View.GONE);