Androidmanifest with multiple tags <application>

Asked

Viewed 83 times

4

I need to use the PARSE and VOLLEY libraries in an Android APP, however, both need to be declared in the TAG Application, on AndroidManifest, but I noticed that there may only be one TAG Application in one AndroidManifest, someone has the solution?

1 answer

-1

Well, after so much breaking my head with this question that seems simple (and is), I decided to post the solution to the problem. Recently I had to use the Parse and Volley libraries in an application I developed, hence the problem, both need to be declared in the Androidmanifest TAG Application, in the property android:name="package.Nominapplication". Well, Androidmanifest only accepts a single TAG Application, but to get around it, just extend (extends) one class from the other, example:

file: Parseapplication.java

Public class ParseApplication extends Application {
...
}

Now just extend Parseapplication Volleyapplication:

file: Volleyapplication.java

Public class VolleyApplication extends ParseApplication {
...
}

result on Androidmanifest:

<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, you guys.

  • To inherit one library from another seems a bit strange. Are you sure that there is no other alternative?

  • Behold this answer in Stack Overflow. Maybe this will help.

  • So, as much as I’ve researched, this was the only solution I could find, as I’m new to JAVA, I don’t know if there’s any kind of problem with this practice, but it worked out that it was beautiful. If I find a more elegant way around this methodology, I’ll be posting another answer. Thanks for the remark.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.