This is the code I added inside. Use Switch (position) to get the current image and add a click event to the corresponding image.
case 0:,
case 1:
The code is as follows. When clicking on the first picture, I want to implement the code in case 0, but I directly report an error and exit. When clicking on the second picture, I can do it. I want to know what is wrong.
By the way, these codes are written in Fragmnt. When clicking on the image, you need to transfer from a Fragment to an Activity. Please give me advice.