The danger of using getSimpleName() as TAG for Fragment

--

When we want to add a Fragment into a container of an Activity, we’ll normally use a TAG as it’s ID.

getFragmentManager().beginTransaction()
.add(containerResource, fragment, fragmentTAG).commit()

What’s a good TAG name we could use? It’s the class name itself. To simplify thing, maybe just use the simple name of the class, given we…

--

--