I want to know what does android:name attribute do?
What's the different between class attribute and it?
I use it for fragment.
Asked
Active
Viewed 3,658 times
1
Ali Motameni
- 2,199
- 3
- 21
- 33
2 Answers
2
Both do the same thing: identify the Java class that is the implementation of the fragment. AFAIK, android:name is the preferred attribute to use.
CommonsWare
- 954,112
- 185
- 2,315
- 2,367
-
android:class is preferable. http://stackoverflow.com/a/13950563/3496570 – Zar E Ahmer Feb 02 '17 at 11:45
1
The android:name attribute specifies the Fragment class to instantiate in the layout.
eracube
- 2,264
- 2
- 12
- 17