Using the same fragment class twice in different containers

My question is pretty simple .... I have one container that I assign to it as an instance of the fragment class.

fragmentTransaction.add(R.id.container2, new PlaceholderFragment2());

My question is: can I use the same class in another place of the container under this (I mean in the same action)

fragmentTransaction.add(R.id.container2, new PlaceholderFragment2());
fragmentTransaction.add(R.id.container3, new PlaceholderFragment2());
+4
source share

Source: https://habr.com/ru/post/1545721/


All Articles