开发者

How to receive notification that android has killed my application?

开发者 https://www.devze.com 2023-04-12 15:36 出处:网络
I want to know how can开发者_运维技巧 we detect that operating system has killed my app due to low memory?

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号