I want an IntentService to run every 10 seconds and put a simply debug line. This is my code:
in the manifest:
<service android:name="com.test.test.TheService" />
Creating the alarm manager to call the service every 10 seconds
am.setRepeating(AlarmManager.RTC_WAKEUP,
cal.getTimeInMillis(),
10000,
servicePendingIntent);
The service itself
public class TheService extends IntentService {
public static int SERVICE_ID = 1;
public TheService() {
super("TheService");
}
@Override
protected void onHandleIntent(Intent intent) {
Log.d("service","I'm in on Handle Intent");
}
}
In the emulator's monitor I see this line every 10 seconds
1270-1297/system_process I/ActivityManager: START u0 {flg=0x4 cmp=com.test.test/.TheService (has extras)} from pid -1
Despite the fact it writes "has extras", I actually didn't add any extras. Generally, It seems fine but the debug is never printed and a breakpoint on the debug code, never stops as if the service does start every 10 seconds but it does nothing.
What am I missing?