There are two classes:
- ListViewActivity extends Activity,
- MyAdapter extends BaseAdapter.
MyAdapter overrides the getView method and creates an item in ListView, which drawn in ListViewActivity.
I want to call setOnClickListener in MyAdapter.getView, but the listener must be placed in another class - not in MyAdapter.
Standard approach is:
MyAdapter.getView ... {
Button button_del = (Button) view.findViewById(R.id.button_del);
button_del.setOnClickListener(this);
}
It is not applicable for me because requires declaring the listener in MyAdapter class.
QUESTION - Can the setOnClickListener refer to the listener in another class ?
PS: button_del.setOnClickListener(ListViewActivity) does not work !