Click here to Skip to main content
15,844,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using recyclerview to display all the post on blog in recyclerview
i will like my users to view the details of each list item in webview when clicked
How can i achieve this kindly help. see my code below

public class MyRecyclerAdapter extends RecyclerView.Adapter<MyRecyclerAdapter.CustomViewHolder> {
    private List<FeedItem> feedItemList;
    private Context mContext;

    public MyRecyclerAdapter(Context context, List<FeedItem> feedItemList) {
        this.feedItemList = feedItemList;
        this.mContext = context;

    public CustomViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_row, null);

        CustomViewHolder viewHolder = new CustomViewHolder(view);
        return viewHolder;

    public void onBindViewHolder(CustomViewHolder customViewHolder, int i) {
        FeedItem feedItem = feedItemList.get(i);

        //Download image using picasso library

        //Setting text view title

        //Handle click event on both title and image click


    View.OnClickListener clickListener = new View.OnClickListener() {
        public void onClick(View view) {
            CustomViewHolder holder = (CustomViewHolder) view.getTag();
            int position = holder.getPosition();

            FeedItem feedItem = feedItemList.get(position);
            Toast.makeText(mContext, feedItem.getTitle(), Toast.LENGTH_SHORT).show();//Webview Activity Here

    public int getItemCount() {
        return (null != feedItemList ? feedItemList.size() : 0);

    public class CustomViewHolder extends RecyclerView.ViewHolder {
        protected ImageView imageView;
        protected TextView textView;

        public CustomViewHolder(View view) {
            this.imageView = (ImageView) view.findViewById(;
            this.textView = (TextView) view.findViewById(;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900