title: unable to navigate from fragment which has a list view to another fragment
body: <p>I have a fragment which contains a list view. Within that fragment I am attempting to  navigate to another fragment as soon as one of the items in the list is clicked but I get an error stating that     </p>
  
  <blockquote>
    <p>java.lang.UnsupportedOperationException: addView(View) is not supported in AdapterView</p>
  </blockquote>
  
  <p>this is my code </p>
  
  <pre><code>private void setupList(View view) {
        //super.onCreate(savedInstanceState);
        //setContentView(R.layout.icons_main);
  
        CustomListAdapter adapter = new CustomListAdapter(this.getActivity(), itemname, imgid);
        //CustomListAdapter adapter=new CustomListAdapter(this, itemname, imgid);
        list = (ListView) view.findViewById(R.id.list);
        //(ListView)view.findViewById(R.id.lv_listview);
        list.setAdapter(adapter);
        list.setOnItemClickListener(new OnItemClickListener() {
  
           @Override
           public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                   int position, long id) {
              String Slecteditem = itemname[+position];
             // Toast.makeText(getApplicationContext(), Slecteditem, Toast.LENGTH_SHORT).show();
  
              Fragment fragment = new SensorInformationChildFragment(); 
              FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
              FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
              fragmentTransaction.replace(R.id.list, fragment);
              fragmentTransaction.addToBackStack(null);
              fragmentTransaction.commit();
  
           }
        });
     }
  </code></pre>
  
  <p>the error I am getting </p>
  
  <pre><code>java.lang.UnsupportedOperationException: addView(View) is not supported in AdapterView
      at android.widget.AdapterView.addView(AdapterView.java:452)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1124)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290)
      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677)
      at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:536)
      at android.os.Handler.handleCallback(Handler.java:808)
      at android.os.Handler.dispatchMessage(Handler.java:103)
      at android.os.Looper.loop(Looper.java:193)
      at android.app.ActivityThread.main(ActivityThread.java:5299)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>