How to receive notification that android has killed my application?
I want to know how can开发者_运维技巧 we detect that operating system has killed my app due to low memory?
Any help appreciated.
Have all your activity extend a base activity. Override the base activity onDestroy() to throwa notification.
If you show the native source code, show this points.
1.] Detect "Not enough memory" situation
(function tryMalloc in /dalvik/vm/alloc/heap.c)
2.] ActivityManager kill the process.
(method requestFinishActivityLocked in ActivityStack.java)
3.] report process is died.
(method appDiedLocked in ActivityManagerService.java)
精彩评论