I began to study the Fragments and faced with the fact that the listener had to hang on a button (in this case, this is a picture). I usually wrote through onClick (View V) and indicated a method in the markup, but I know that this does not work in Fragments. If I hang the listener anonymously, then everything works, but I want the Fragment of the implements View.OnClickListener and there was one method where by ID find out what the button is and then already process. In short, I’m not catching up on what to specify in image imageRight.setOnClickListener imageViewRight.setOnClickListener(!!!!!!);
The code below works but is not convenient.
imageViewRight.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { } });