private OnClickListener startListener = new OnClickListener() {
public void onClick(View v) {
startService(new Intent(SimpleServiceController.this,
SimpleUpdateService.class));
startActivity(new Intent (this, AlarmManagerListening.class));
}
};
startActivity执行时发生问题。它不允许我开始一项活动。我可以知道代码有什么问题吗?onClick开始另一个活动
post logcat plz – KOTIOS
对'startActivity()'方法使用'SimpleServiceController.this'而不是'this'。 – user370305
@ user370305像魅力一样工作!非常感谢! –