How to declare global variables in Android?

前端 未结 17 2992
死守一世寂寞
死守一世寂寞 2020-11-21 04:12

I am creating an application which requires login. I created the main and the login activity.

In the main activity onCreate method I added the following

17条回答
  •  死守一世寂寞
    2020-11-21 05:02

    I couldn't find how to specify the application tag either, but after a lot of Googling, it became obvious from the manifest file docs: use android:name, in addition to the default icon and label in the application stanza.

    android:name The fully qualified name of an Application subclass implemented for the application. When the application process is started, this class is instantiated before any of the application's components.

    The subclass is optional; most applications won't need one. In the absence of a subclass, Android uses an instance of the base Application class.

提交回复
热议问题