Kingfisher Phuoc
Kingfisher Phuoc

Reputation: 8190

What's difference between 2 activities in manifest file?

Usually in Android Manifest file I see 2 ways to declare activity name:

<activity android:name=".MyActivity" android:label="@string/app_name">...

and

<activity android:name="MyActivity" android:label="@string/app_name">...

Two ways work well. However, I don't know what's difference in those ways! Can anyone explain it? And what's best practice to declare an activity in android? Thanks!!

Upvotes: 1

Views: 190

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006819

However, I don't know what's difference in those ways!

There is no difference today. Both mean that MyActivity should exist in whatever Java package you have in the package attribute on the root <manifest> element.

And what's best practice to declare an activity in android?

Either of those are fine.

Upvotes: 2

Related Questions