Implement OnItemClick inside a SimpleCursorAdapter
<p>I have a SimpleCursorAdapter Class, and I want to set an OnItemClick method everytime when the row is clicked.</p>

<p>The method looks like this:</p>

<pre><code>protected void onItemClick(AdapterView&lt;?&gt; l, View v, int position, long id) {
            Intent listIntent = new Intent(DetailsActivity.class,this);
            listIntent.putExtra("spendino.de.ProjectDetail.position",position);

            listIntent.setData(Uri.withAppendedPath(Uri.withAppendedPath(
                    Provider.CONTENT_URI, Database.Project.NAME), Long
                    .toString(id)));

            startActivity(listIntent);
}
</code></pre>

<p>but it always gives me an error on this line: <code>Intent listIntent = new Intent(DetailsActivity.class,this);</code>
It asks me to remove the arguments.</p>

<p>Can anybody help me with this?</p>

<p><strong>UPDATED</strong></p>

<pre><code>@Override
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            View convertView = mInflater.inflate(R.layout.listitems, null);
            convertView.setClickable(true);
            convertView.setFocusable(true);
            convertView.setBackgroundResource(android.R.drawable.menuitem_background);
            convertView.setOnItemClickListener(ProjectsList.this);

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

<p>the first solution gave me no error, but when I set the method on my View, it says that setOnItemClickListener is undefined for convertView</p>

<p><strong>UPDATED</strong></p>

<pre><code>convertView.setOnClickListener(new OnClickListener() {
                 public void onClick(View view) {
                  Intent myIntent = new Intent(view.getContext(), DetailsActivity.class);
                  myIntent.putExtra("spendino.de.ProjectDetail.position",position);
                  myIntent.setData(Uri.withAppendedPath(Uri.withAppendedPath(
                            Provider.CONTENT_URI, Database.Project.NAME), Long
                            .toString(id)));
                  view.getContext().startActivity(myIntent);
                 }
                });
</code></pre>

<p><code>setOnClickListener</code> isn't working, I got an error on 'position' and 'id' how should I declare it?
Because those 2 things are mainly found on the <code>setOnItemClickListener</code> method</p>
