I have an activity "PSActivity" and an IntentServive "StalkService". I am starting the service but the service never executes, at least according to the debugger. The following code starts the service inside PSActivity and I am sure this is getting executed...
public void cbRealTime_Clicked(View v) {
//start the StalkService
if (cbRealTime.isChecked()) {
Intent i = new Intent(this, StalkService.class);
i.putExtra("mystuff", "this is my stuff");
this.startService(i);
} else {
//stop the service here
}
}
Here is the code for the service...
public class StalkService extends IntentService {
public StalkService() {
super("StalkService");
// must override constructor
}
@Override
protected void onHandleIntent(Intent intent) {
// TODO Auto-generated method stub
String data = (String) intent.getExtras().get("mystuff");
data = data + "debug";
}
}
I have a breakpoint set at data = data + "debug"; that never is hit. It looks like onHandleIntent is never getting executed. I'm testing with the emulator. What am I forgetting to do? Thanks, Gary