Let's try to say you cant to create a new activity based on some text in the custom list item and this is your custom view holder class
public static class CustomViewHolder extends RecyclerView.ViewHolder implements OnClickListener {
public TextView titleView;
public ViewHolder(View itemLayoutView) {
super(itemLayoutView);
titleView = (TextView) itemLayoutView.findViewById(R.id.item_title);
}
@Override
public void onClick(View v) {
}
}
In your onClick() method,Start an activity and pass in some extras like
@Override
public void onClick(View v) {
Intent myIntent = new Intent(view.getContext(),ItemActivity.class);
myIntent.putExtra("title",titleView.getText());
startActivity(myIntent);
}
Then create an activity class file that will represent your ItemActivity in my case ItemActivity.java
and in the onCreate() method, we can get our extras and use it the way we like.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item);
String title =this.getIntent().getStringExtra("title");
}
You can now may be set it up as the title of your new activity actionbar likeactionBar.setTitle(title);