I've a strange behavior with an android app when it runs on a S3 with android 4.3: every time app goes to background (pressing back button), when it's resumed, it calls the onCreate()
method of Application
class.
Reading the Android documentation, Application onCreate() should be called the first time app runs, when app is destroyed or if the device has low memory, but seems it's not my case (I added a log into onLowMemory())
So my question is: in which conditions Application onCreate()
method is called? Does it depends on device and/or android versions?
Activity
, Android will destroy thatActivity
. If there are no active activities in an OS process, Android will kill off that OS process. Different manufacturers and different devices will behave differently as to how aggressively they kill off non-active OS processes. It sounds like this device has a very agressive algorithm (which could be because it has a small memory footprint, or is trying to save battery, etc.) – Ninfaningal