Can the global Android Application
object, which is obtained via getApplication()
, implement an AIDL callback interface and communicate with remote services? Also, can it launch Activities and send intents?
From my understanding, the operations above are typically reserved for Android app components: activities, services, and content providers. Thus I am not sure if an Application
object can perform these as we开发者_如何学JAVAll.
Not sure if you already know, but you can define your own entry point, aka the Application
by extending the Application class. Also you need to tell in manifest the name of the class that will act as Application
.
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:name=".MyApplicationClass"
android:debuggable="true">
And since now you are in charge of your MyApplicationClass you can do those things as well.
精彩评论