I am using android.app.Application
to create a single instance. For some reason I see Android kills my Instance
and recreate (call onCreate
). How can I stop this from happening ? I tried adding logs on onTerminate
and onLowMemory
but non of these get called before Instance
get killed.
Please advice.
public class Instance extends Application {
@Override
public void onCreate() {
super.onCreate();
}
@Override
public void onTerminate() {
super.onTerminate();
Log.e(TAG, "onTerminate");
}
@Override
public void onLowMemory() {
super.onLowMemory();
Log.e(TAG, "onLowMemory");
}
}