开发者

Android: Can the Global Application Object Bind to Remote Services and Launch Activities?

开发者 https://www.devze.com 2023-01-07 17:46 出处:网络
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 in

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消