startservice.setonClickListener(this);编译不通过
下面代码却是OK
startservice.onClickListener onclicklistenner = new Button.OnClickListener(){ //@Override public void onClick(View v) { }};
缺少implements View.OnClickListener,加上即可
public class MainActivity extends AppCompatActivity implements View.onClickListener {} @Override public void onClick(View view) { }