AndroidManifest with multiple tag application

4

I need to use the PARSE and VOLLEY libraries in an Android APP, but both need to be declared in the TAG Application, in AndroidManifest , but I noticed that there could only be one TAG Application in a AndroidManifest , does anyone have the solution?

    
asked by anonymous 26.11.2014 / 12:22

1 answer

-1

Well, after so much breaking my head with this question that seems simple (and it is), I decided to post the solution to the problem. I recently needed to use the Parse and Volley libraries in an application I developed, hence the problem, both of which need to be stated in the AndroidManifest TAG Application, in the android: name="package.NameApplication" property. Well, AndroidManifest only accepts a single TAG Application, but to get around this, just extend one class from another, for example:

file: ParseApplication.java

Public class ParseApplication extends Application {
...
}

Now just extend ParseApplication's VolleyApplication:

file: VolleyApplication.java

Public class VolleyApplication extends ParseApplication {
...
}

AndroidManifest result:

<application
android:name="pacote.VolleyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
.
.
.
</activity
</application>

That's it, people.

    
26.11.2014 / 12:55