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

无法保活Service,魅族Max6 7.0 #5

Open
tulongchao opened this issue Dec 4, 2017 · 3 comments
Open

无法保活Service,魅族Max6 7.0 #5

tulongchao opened this issue Dec 4, 2017 · 3 comments

Comments

@tulongchao
Copy link

public class MainActivity extends Activity implements View.OnClickListener {

private TextView mKillService, mStartService;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mKillService = (TextView) findViewById(R.id.kill_service);
    mStartService = (TextView) findViewById(R.id.start_service);
    mKillService.setOnClickListener(this);
    mStartService.setOnClickListener(this);
    WorkService.startService(this);
}


@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.kill_service:
            KeepAliveManager.INSTANCE.stopKeepAliveSerice(MainActivity.this);
            break;
        case R.id.start_service:
            KeepAliveManager.INSTANCE.startKeepAliveService(MainActivity.this);
            break;
    }
}

}

@xuningjack
Copy link
Owner

already fixed.

@tulongchao
Copy link
Author

大神,我运行你的demo还是能被杀死,我直接杀死进程的,魅族6.0

@xuningjack
Copy link
Owner

直接杀死什么进程,保活的是WorkService,不是demo,你把demo干死了是不可以的,Android的底层机制。

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