I have a ListActivity with my customized adapter and inside each of the view, it may have some buttons, in which I need to implement OnClickListener
. I need to
public class MyAdapter extends Adapter {
private Context context;
public MyAdapter(Context context) {
this.context = context;
}
public View getView(...){
View v;
v.setOnClickListener(new OnClickListener() {
void onClick() {
Intent intent= new Intent(context, ToActivity.class);
intent.putExtra("your_extra","your_class_value");
context.startActivity(intent);
}
});
}
}