I have an android APP where I defined some of activity methods (see example below).
Is there anyway to identify when the my APP leaves onPause method to be killed due to memory required from APP with higher priority? Tnx in advanced
public class Activity extends ApplicationContext {
private static final String TAG = "TEST";
private static final boolean D = true;
public void onCreate(Bundle savedInstanceState);
}
public void onPause();
super.onPause();
if(D) Log.e(TAG, "- ON PAUSE -");
}
public void onStop() {
super.onStop();
if(D) Log.e(TAG, "- ON STOP -");
}
public void onDestroy();
super.onDestroy();
if(D) Log.e(TAG, "- ON Destroy -");
}
}
You can override Activity.onLowMemory() method.
http://developer.android.com/reference/android/app/Activity.html#onLowMemory ()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.