title: OnItemClick how to get text value of clicked item from list view
body: <p>I want to get the text value of a list item and pass it to an edit text in another fragment when list item is clicked. </p>
  
  <p>Here is my code to get the value and pass it to the other fragment.</p>
  
  <pre><code>    lv_categories.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
              String clickedItem = adapterView.getItemAtPosition(i).toString().trim();
              SM.sendData(clickedItem);
          }
      });
  </code></pre>
  
  <p>send data method</p>
  
  <pre><code>@Override
  public void sendData(String message) {
      String tag = "android:switcher:" + R.id.container + ":" + 1;
      SearchFragment searchFragment = (SearchFragment) getSupportFragmentManager().findFragmentByTag(tag);
      searchFragment.displayReceivedData(message);
  }
  </code></pre>
  
  <p>I am able to receive the data but not as is displayed eg. Instead of receiving the list item "Christmas", I am getting something like "com.example.johndoe.project.Category@fa9dc73"</p>
  
  <p>Also how am I able to change fragments on click?</p>
  
  <p>Any help is greatly appreciated thank you!</p>