Unable to start service Intent: not found

The service must be also be included in the Manifest:

<service android:name="com.x.x.serviceclass"></service>

Make sure you have declared your service in the manifest file.

<service  
      android:name=".MyService"  
      android:enabled="true" >
</service>

and try writing getApplicationContext() instead of "this" keyword

startService(new Intent(getApplicationContext(), MoodyService.class));

Solved

I deleted the period in the beginning of the package name in the manifest and it worked, in another words:

This doesn't work:

.yourPackage.YourClass

But this does work:

 yourPackage.YourClass

And in the main:

Intent intent = new Intent(this, MoodyService.class);
        this.startService(intent);

But it goes against what is written in the documentation:

android:name The name of the Service subclass that implements the service. This should be a fully qualified class name (such as, "com.example.project.RoomService"). However, as a shorthand, if the first character of the name is a period (for example, ".RoomService"), it is appended to the package name specified in the element. Once you publish your application, you should not change this name (unless you've set android:exported="false").

There is no default. The name must be specified.


I don't know why you are using that package-like name for your service name, but why don't you use class name for starting the service?

Intent intent = new Intent(context, YourService.class);
context.startService(intent);