aspose file tools*
The moose likes Android and the fly likes Problem with BroadcastReceiver and IntentService Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Problem with BroadcastReceiver and IntentService" Watch "Problem with BroadcastReceiver and IntentService" New topic
Author

Problem with BroadcastReceiver and IntentService

Ozzy Boshi
Greenhorn

Joined: Sep 21, 2012
Posts: 7
Hello JavaRanch Forum,
I am a begingger in Android Java Programming and I stumbled upon a problem.

I want, every time my phone boots up, a service that is activated every x minutes.
In order to do this I tried to use a BroadcastReceiver that creates a new AlarmManager object in this way.



I set up my android manifest file and all seems ok to me.
When the phone boots up i see the "Receiver OK" message on my Logcat window.
At this stage i'd expect that this broadcast receiver, every minute, is set to launch a new instance if UpdaterService.class but it doesn't happen.
Right now the UpdaterService class is a subclass of IntentService and it's made of only of a constructor and a onHandleIntent() method (overridden).
Inside the onHandleIntent there is only a Log.d() , so at the end i would expect to see this Log.d passing through my Logcat window but this does not happen, can someone tell me why?
If i try to launch UpdaterService from an Activity using startservice(), updaterservice fires up and the Logcat window show the messages (but only once of course)


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with BroadcastReceiver and IntentService