@Override public void onCheckedChanged(CompoundButton arg0, boolean isChecked) { // TODO Auto-generated method stub if (isChecked) { Intent hsintent = new Intent(context, HelloService.class); context.startService(hsintent); } else { Intent intent = new Intent(context, HelloService.class); ((MainController) context).stopService(intent); } }