Ben Ben - 6 months ago 13
Android Question

Android ActivityNotFoundException despite everything being correct in Eclipse

I created this simplest possible service project (based on this) in Eclipse 3.8 with the most up to date Android Tools and posted it here:

I get the following error when I start it:

02-03 00:18:45.984: E/AndroidRuntime(20145): java.lang.RuntimeException:
Unable to start activity ComponentInfo{net.softmann/net.softmann.HelloActivity}:
Unable to find explicit activity class {net.softmann/net.softmann.HelloService};
have you declared this activity in your AndroidManifest.xml?

But it is in my manifest!! What am I doing wrong? I have also tried using "net.softmann.HelloService" instead of ".HelloService" and still no luck.


The exception says you're trying to start an activity net.softmann/net.softmann.HelloService and it is not found.

Looking at your manifest file, you have a service with such name.

Looking at your activity code, you have

startActivity(new Intent(getApplicationContext(), HelloService.class));

Start services with startService() and not startActivity().