Questions tagged [android-application-class]

Extending Android's Application class can be very useful to maintain global state, initialise a module, and so on, before any other part of your code runs.

Android Developer Docs say:

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.

97 questions
-2
votes
1 answer

Accessing Database created in one activity from another activity

I have created an instance of my database helper class in the main activity. I want to access that instance from any another activity where I can update that database. I have created an instance with getApplicationContext() as context but it's…
-2
votes
1 answer

Using this.getApplicationContext(); with multiple application classes

In my app i need to store the location to firebase so im using two location classes as application because i need to store location for two different entities First Application class public class FirstApplicationClass extends MultiDexApplication…
-2
votes
2 answers

How to check app uninstall and send information to the server in a Phone?

Need some information about how to check whether an Android app is being uninstalled or is uninstalled so that App Server comes to know that a user has uninstalled the app. Any Help is appreciated.
-2
votes
2 answers

MyApplication.java did not run at the second time app started?

I have 1 application custom class MyApplication.java and 1 activity MainActivity.java. At the first time when I start app, class MyApplication.java run correctly. Then I exit app by finish the activity MainActivity.this.finish(); Then I click the…
Qk Lahpita
  • 427
  • 2
  • 10
  • 18
-4
votes
1 answer

Android - Using this or getApplicationContext() in MyApplication class?

I have created a MyApplication class that extends Application and have defined it in the manifest. Within MyApplication's onCreate() method, is there any difference between using this or getApplicationContext() in order to get the application…
ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
-4
votes
1 answer

Is there any function in Android to output random stuff from a collection of things in database ? For more details read information given below

I am making an Android app for automatic generation of question paper. In which I've made a database where I've stored questions but I'm facing problem in generating ramdon questions so that questions don't get repeated in the same question paper.…
-4
votes
1 answer

Getting null pointer exception when getting values from setting preference

In my application i have create the settings preference in xml folder and assigned it to preference manger using the method. But when im trying to get values from the SharedPreferences it's throwing null pointer exception.... public class RemindMe…
rhsabbir
  • 247
  • 1
  • 6
  • 19
1 2 3 4 5 6
7