My suggestion would be to revisit your onItemClickListener
implementation.
You should not need to access parent at all for what you are trying to do. Try this.
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
TextView fact = (TextView) view.findViewById(R.id.c_id);
Log.d("ListItem Clicked", "id: " + id + " position: "
+ position + " artist " + fact.getText());
}
});
The view argument supplied in the method is actually the view being click on.
view; The view within the AdapterView that was clicked (this will be a view provided by the adapter)
Please refer to AdapterView.OnItemClickListener for more details.
The parent is there to help you identified which AdapterView
that is being acted on. For example, say if you have two ListAdapter
but only want to use one listener then it going to help you specify which is the one.