How can pass data from Adapter to Fragment?
<p>How can pass data between <code>adapter</code> and <code>fragment</code>?</p>

<p>My adapter:</p>

<pre><code>finalHolder.spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
        finalHolder.spinner.setSelection(position);
        selState = finalHolder.spinner.getSelectedItem().toString();
        System.out.println(selState);
        Toast.makeText(getContext(),
                "Clicked on Planet: " + selState + "", Toast.LENGTH_SHORT).show();

        Fragment fragment = new Fragment();
        Bundle bundle = new Bundle();
        bundle.putString("key", selState);
        Log.i("BUNDLE", bundle.toString());
        fragment.setArguments(bundle);
    }
});
</code></pre>

<p>My fragment:</p>

<pre><code>public  class MyListFragment extends Fragment{

    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_list2, container, false);

        /*Bundle bundle = this.getArguments();
        String strtext = bundle.getString("key", " ");
        System.out.println(strtext);*/
        System.out.println("prima ancora");

        Bundle arguments = this.getArguments();
        System.out.println("prima");
        if (arguments != null) {
            System.out.println("dopo");

            //String userId = arguments.getString("key");
                //System.out.println("finalmente:"+userId);
             user = getArguments().getString("Key");


        } 

}
</code></pre>