Here’s my Activity opening.
public class SettingActivityR extends CommBaseActivity implements OnItemClickListener
the CommBaseActivity is a class handle communication that extends from Activity
and the Structure in SettingActivityR contains a listView names SeverListView
I had set these settings in Activity onCreate Method
SeverlistView.setAdapter(this.m_adapter);
SeverlistView.setClickable(true);//already set it Clickable!
SeverlistView.setOnItemClickListener(this);
and override the Method
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
SeverDataList targetSeverItem=m_adapter.items.get(arg2);
Log.i("bird","zzz");
}
The Adapter works fine,but the OnItemClickListener didn’t work at all. The debug mode don’t even run into this method. Why is that?
SettingActivityR should extend ListActivity instead.
In the onCreate(), call setListAdapter(this.m_adapter);
From here, the onListItemClick() method should handle the callback for you.