Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

借你的项目提一下EMUI系统android7.0的BUG,寻求一下解决思路 #48

Closed
zwping opened this issue Aug 7, 2017 · 3 comments

Comments

@zwping
Copy link

zwping commented Aug 7, 2017

**问题:**一般都会在onDestory()方法中执行释放内容,但在华为android7.0的手机上面,就会出现onDestory()延迟执行,在自个项目中做了一些数据统计,得出的结论是(AActivity--> BActivity,当B中需要执行大量方法时,A onDestory()会延迟执行(最长10s));
在您的项目启动页中也测试了一下,会延迟执行3s左右;
代码:
`@Override
protected void onPause() {
super.onPause();
time = System.currentTimeMillis();
}

private long time;

@Override
protected void onDestroy() {
    super.onDestroy();
    if (System.currentTimeMillis() - time > 500)
        Log.i("TAG", getLocalClassName() + "destroy超过了500Ms:" + (System.currentTimeMillis() - time));
}`
@youlookwhat
Copy link
Owner

这个我还没有研究过,你是指AActivity打开BActivity的同时关闭AActivity,这时候走A onDestory()会延迟执行吗?这有什么影响呢?

@zwping
Copy link
Author

zwping commented Aug 8, 2017

是的,最开始以为我的代码在7.0上有问题,就在寻到了您这点赞量较高的项目上测试,神奇,竟然也有这种问题...
A onDestory()方法延迟执行时间和B中内容加载量正正比,最长10s,目前在锤子和华为7.0的手机上有测试,均为这个现象
影响:A的方法的取消、对象清空会收到严重干扰,当然这是个人习惯。

@youlookwhat
Copy link
Owner

恩恩 我这边暂时没有考虑这方面的东西,以为最近比较忙,准备之后再研究~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants