android can't use getLayoutInflater in fragment
<p>I am using fragments and i trying to build a list i am getting from the database. Everything seems to be fine except for the following piece of code </p>

<pre><code>listadapter = new charitylist(this, getLayoutInflater());
</code></pre>

<p>I already set the layout inflater here </p>

<pre><code>LayoutInflater lf = getActivity().getLayoutInflater();
</code></pre>

<p>But i don't have any idea how to use the layoutinflater lf int the listadapter. </p>

<p>This is the full code</p>

<pre><code>@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        LayoutInflater lf = getActivity().getLayoutInflater();
        View view = lf.inflate(R.layout.activity_charity, container, false);

        listView = (ListView) view.findViewById(R.id.charityList);

        listadapter = new charitylist(this, getLayoutInflater());

        listView.setAdapter(listadapter);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {


                //String trackName = listadapter.getItem(position).optString("track_name", "");


            }

        });

        setType = "favourite";

        getlist(setUrl, setType);

        return view;
    }
</code></pre>

<p>I have no idea how to get this working. I tried several things to get this to work. But i need to initiate the adapter. </p>

<p>Thank for your help.</p>