Adapter 回调Acticity
Adapter类
private OnItemClickLitener mOnItemClickLitener;
//设置回调接口
public interface OnItemClickLitener{
void onItemClick(View view, int position);
}
public void setOnItemClickLitener(OnItemClickLitener mOnItemClickLitener){
this.mOnItemClickLitener = mOnItemClickLitener;
}
Acticity 中调用
titleAdapter.setOnItemClickLitener(new TitleAdapter.OnItemClickLitener() {
@Override
public void onItemClick(View view, int position) {
}
});