Use ArrayList in Activity as content for RecyclerView Adapter in frament
<p>I have this <code>Activity</code> inside of which there are two fragments in a TabLayout.</p>

<p>In my <code>Activity</code> there is an static <code>ArrayList</code>.
I'm my fist <code>Fragment</code>, let's call it <code>FragmentOne</code> I have one <code>RecyclerView</code> and the second <code>Fragment</code>, <code>FragmentTwo</code> i where I need the magic to happen.</p>

<p>In <code>FragmentTwo</code>, I'm calling that same <code>ArrayList</code> from my <code>Activity</code> and adding one or more items to it. In <code>FragmentOne</code> I'm also calling the same <code>ArrayList</code> and passing it's value to a non static <code>ArrayList</code>, the one that is used in my <code>RecyclerView</code>'s adapter.</p>

<p>How I can call the method <code>notifyDataSetChanged()</code> of my <code>FragmentOne</code>'s <code>RecyclerView</code> in my second <code>Fragment</code>, so the <code>RecyclerView</code> would update it's content?</p>

<p>Or there is a more efficient way of sending the item to my fist <code>Fragment</code> <code>ArrayList</code> that I use in my <code>RecyclerView Adapter</code>?</p>

<p>My Activity:</p>

<pre><code>public class MainActivity {

    TabLayout tabLayout;
    ViewPager viewPager;
    ViewPagerAdapter viewPagerAdapter;
    FragmentOne fragmentone;

    // The ArrayList used as FragmentOne RecyclerView's Adapter
    public static ArrayList&lt;Contacts&gt; contactsArrayList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        fragmentOne = new FragmentOne();

        contactsArrayList = new ArrayList&lt;&gt;();

    }

}
</code></pre>

<p>FragmentOne RecyclerView:</p>

<pre><code>public class FragmentOne extends Fragment implements View.OnClickListener {

    // RecyclerView's adapter
    ContactsAdapter ctcAdapter;

    // RecyclerView
    RecyclerView rvContacts;

    public FragmentOne() {
        // Required empty public constructor

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_one, container, false);

        // RecyclerView
        rvContacts = (RecyclerView) view.findViewById(R.id.rvContacts);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        rvContacts.setLayoutManager(linearLayoutManager);

        // Here I'm adding the static list from the Main Activity in the adapter
        ctcAdapter = new ContactsAdapter(getContext(), MainActivity.contactsArrayList);

        rvContacts.setAdapter(ctcAdapter);

        return view;
    }
}
</code></pre>

<p>The only thing I need is how to call the <code>ctcAdapter.notifyDataSetChanged()</code> in my second fragment, after I add a new Item to the <code>contactsArrayList</code> to make the list in the firs fragment show the added item.</p>