1

I want to know what does android:name attribute do? What's the different between class attribute and it? I use it for fragment.

Ali Motameni
  • 2,199
  • 3
  • 21
  • 33

2 Answers2

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
1

The android:name attribute specifies the Fragment class to instantiate in the layout.

eracube
  • 2,264
  • 2
  • 12
  • 17