I am using recyclerview. And there are two textview in recyclerview item. I am unable to add multiple text in clipboard. But I need both text. Here is my code.
public NameViewHolder(View itemView) {
super(itemView);
name = itemView.findViewById(R.id.name);
meaning = itemView.findViewById(R.id.meaning);
copyText = itemView.findViewById(R.id.txtCopy);
copyText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
clipboardManager = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
clipData = ClipData.newPlainText("text",name.getText());
clipboardManager.setPrimaryClip(clipData);
}
});
}
Now I want to add both textview text into clipboard. Please help me. Thanks in advance.