android – What is the rule for Ids, with multiple instances of a fragment

I have this simple fragment (a button counting clis) public class FragmentBasique extends Fragment { //…. private View v; private int count = 0; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v = inflater.inflate(R.layout.fragment_basique, container, false); update_button(); ((Button)v.findViewById(R.id.buttonFrag)).setOnClickListener( (_v) -> { count++; update_button(); } ); return v; } private void update_button(){ ((Button)v.findViewById(R.id.buttonFrag)).setText(“clics … Read more