I am using Android global variable example.
How do I add another "application" tag in AndroidManifest.xml ?
According to the documentation, only one application tag can be inserted in the manifest.
Quote from doc:
"Only the manifest and application elements are required, they each must be present and can occur only once."
If you're following the example at the given link, just add the android:name
and android:label
XML element to your current application tag and it'll work just fine.
Example of my application tag in an application I'm developing at the moment:
<application
android:name=".Globals"
android:debuggable="true"
android:icon="@drawable/icon"
android:label="@string/app_name" >
Globals is my application class.
I know this question was asked a long time ago but using Android Studio 3.0 and higher, I came across the same problem and did not find anything online that helped.
After a lot of research and my own testing, I found out how to successfully implement two or more classes that both extend android.app.Application
into the Manifest's <Application/>
.
First Class File:
public abstract class MyClass1 extends Application {
// ...
}
Second Class File:
public class MyClass2 extends MyClass1 {
// ...
}
Manifest File:
<application
android:name="com.mydomain.myapp.MyClass2">
<!-- Rest of code here... -->
</application>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With