Reputation: 1694
I am working on an Android library and want to programmatically access the android:name
attribute of the <application>
tag from the Manifest file. According to official documentation, this is the correct way to get the android:name
attribute.
myApp.applicationInfo.name //myApp is the instance of my custom Application subclass
This works fine on devices with Android API > 24. But if I use a device running Android API below that, it returns null.
PS 1: I am not interested in the application label as suggested here.
PS 2: This answer suggests that we use applicationInfo.className
instead, but I cannot find any official documentation/code sample which clearly states this.
Upvotes: 0
Views: 98