开发者

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)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜