title: replacing fragment with another fragment with OnClick on a Listview
body: <pre><code>public class Fragment_01 extends ListFragment {
  
  String string[]={"Contact 1","Contact 2","Contact 3","Contact 4","Contact 5"};
  
  
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container ,Bundle saveInstanceState) {
  
          View myview = inflater.inflate(R.layout.fragment_fragment_01, container, false);
          ListView listView= (ListView) myview.findViewById(android.R.id.list);
          ArrayAdapter&lt;String&gt; array = new ArrayAdapter&lt;String&gt;(getActivity(), android.R.layout.simple_list_item_1,string);
          listView.setAdapter(array);
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
  
             public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
              FragmentManager fm = getFragmentManager();
              FragmentTransaction ft = fm.beginTransaction();
              Fragment_03 f3 = new Fragment_03();
              ft.replace(R.id.linearLayout2, f3);
              ft.commit();
  
  
  
  
             }
  
          });
          return myview;
      }
  
  
          }
  </code></pre>