2

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,567
  • 3
  • 24
  • 34

2 Answers2

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
1

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

eracube
  • 2,484
  • 2
  • 15
  • 18