and I have a screen in which two cardview book and solution
When I choose Class 6 and Click Book, its show only class 6 book
When I choose Class 7 and Click Book, its show only class 7 book
and also
When I choose Class 6 and Click Solution, its show only class 6 Solution
When I choose Class 7 and Click Solution, its show only class 7 Solution
This is programming logic. You have already been warned about reading and studying and not asking for a ready-made solution.
To have a solution ready, you must hire a programmer.