I have read about application object in android site but I couldn’t understand.
What is application object android?
What is the use of application object
When we should use application object
Please explain with example.
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Application object is an object whose lifecycle is same as our Application.
When Application starts this object is created automatically by Android Framework.
When you want to share data between more than one activities of your application or you want to retain something at application level.In that scenario you can use Application object as a global store for your application.
Example::
In your manifest mention it as follows::
To access application object in any of the activities.Use the following code.
I think this is quite enough for you to grab the concept of application object.