Skip to content

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

@tulongchao

Description

@tulongchao

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;
    }
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions