Application, applicationform

Source: Internet
Author: User

Application, applicationform

Base class for maintaining global application state. You can provide your own implementation by creating a subclass and specifying the fully-qualified name of this subclass as the "android:name" attribute in your AndroidManifest.xml's <application> tag. The Application class, or your subclass of the Application class, is instantiated before any other class when the process for your application/package is created.

The base class used to maintain the global application status. You can create a subclass and run it in AndroidManifest. the "android: name" attribute under the <application> label of xml specifies a fully qualified class name to provide your own implementation. The Application class or the subclass of the Application you created will be instantiated before any class created by your application/package process.

Note: There is normally no need to subclass Application. In most situations, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), include Context.getApplicationContext() as a Context argument when invoking your singleton's getInstance() method.

Note: Generally, Application subclass is not required. In most cases, static Singleton classes provide the same functionality in a more modular manner. If your Singleton class requires a global context (for example, registering a broadcast receiver), The getInstance () method of your Singleton class contains Context. getApplicationContext () is used as Context.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.