Created
December 1, 2017 01:11
-
-
Save javikin/dc661fe252a5fb6ca5b0fcb2be618f45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { | |
... | |
private CallBackItemList mListener; | |
public MyAdapter(String[] myDataset, CallBackItemList listener) { | |
... | |
mListener = listener; | |
} | |
... | |
public interface CallBackItemList { | |
void onClickActionItemList(); | |
void onClickActionButtonItemList(); | |
} | |
@Override | |
public void onBindViewHolder(ViewHolder holder, int position) { | |
holder.mView.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
mListener.onClickActionItemList(); | |
} | |
}); | |
holder.mButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
mListener.onClickActionButtonItemList(); | |
} | |
}); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment