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 4,396 times
2

Ali Motameni
- 2,567
- 3
- 24
- 34
2 Answers
3
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
- 986,068
- 189
- 2,389
- 2,491
-
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,484
- 2
- 15
- 18