Error setOnClickListener from an android app
<p>Hey guys I've been having problems with a code I'm using for practice.
The thing is that it works for the guy giving the tutorial, but it doesn't work for me. My question is how do I fix it?</p>

<pre><code> package bt.sismo;


import android.os.Bundle;
import android.view.View;
import android.widget.Toast;//
import android.widget.ListView;//
import android.widget.ListAdapter;//
import android.widget.ArrayAdapter;//
import android.widget.AdapterView;//
import android.app.Activity;//

public class MainActivity extends Activity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String[] foods = {"Bacon", "Ham", "Tuna", "Candy", "Meatball", "Potato"};
        ListAdapter bryansAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, foods);
        ListView bryansListView = (ListView) findViewById(R.id.bryansListView);
        bryansListView.setAdapter(bryansAdapter);

        bryansListView.setOnClickListener(
                new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                        String food = String.valueOf(parent.getItemAtPosition(position));
                        Toast.makeText(MainActivity.this, food, Toast.LENGTH_LONG).show();
                    }
                }

        );
    }
}
</code></pre>

<p>It later gives me this error in the logcat</p>

<pre><code>    Error:(26, 23) error: no suitable method found for setOnClickListener(&lt;anonymous OnItemClickListener&gt;)
    method View.setOnClickListener(OnClickListener) is not applicable
    (argument mismatch; &lt;anonymous OnItemClickListener&gt; cannot be converted to OnClickListener)
    method AdapterView.setOnClickListener(OnClickListener) is not applicable
    (argument mismatch; &lt;anonymous OnItemClickListener&gt; cannot be converted to OnClickListener)

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
&gt; Compilation failed; see the compiler error output for details.
</code></pre>