title: How can I pass the item String that I selected from ListView to another fragment?
body: <p>I am trying to pass the data (a string that I select) from one fragment from a listview to another fragment in an edittext. How is this possible in this case?</p>
  
  <p>Can I use bundle? If yes, how?</p>
  
  <p>First fragment:</p>
  
  <pre><code>public class AirportPostFragment extends Fragment {
  
  String stringsList[];
  ArrayAdapter&lt;String&gt; adapter;
  private ListView listViewAirports;
  private EditText editSearch;
  Context myContext;
  XmlPullParser parser;
  HashSet airport_list;
  HashSet&lt;String&gt; list = new HashSet&lt;&gt;();
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_airportpost, container, false);
  
      listViewAirports = (ListView) rootView.findViewById(R.id.listView_airports);
      editSearch = (EditText) rootView.findViewById(R.id.search_airport);
      adapter = new ArrayAdapter&lt;&gt;(getActivity(),android.R.layout.simple_list_item_1, stringsList);
  
      listViewAirports.setAdapter(adapter);
      listViewAirports.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,
                                  long id) {
              FragmentManager fm = getActivity().getFragmentManager();
              fm.beginTransaction().replace(R.id.content_main, new FinishPostFragment()).commit();
          }
      });
  
      searchAirport();
      return rootView;
  }
  </code></pre>
  
  <p>SecondFragment:</p>
  
  <pre><code>public class FinishPostFragment extends Fragment{
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_finishpost, container, false);
  
      return rootView;
  }
  
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      inflater.inflate(R.menu.finish_post_button, menu);
  }
  }
  </code></pre>