I am Parsing Json data in fragment. To get a view of this Json data I used RecycleView. In this fragment I showed short detail of some post. I want that when user click the recycleView it will go to another activity and show details of this post. How to make my RecycleView clickable?
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_recent_post, container, false);
recentpostRecycleView = (RecyclerView) view.findViewById(R.id.recent_posts);
recentpostRecycleView.setLayoutManager(new LinearLayoutManager(getActivity()));
recentPostAdapter = new RecentPostAdapter(getActivity());
recentpostRecycleView.setAdapter(recentPostAdapter);
sendJsonRequest();
return view;
}
My RecycleView ScreenShoot: