I have 2 different apps in 2 different Application Projects in Eclipse. I will call them H and G. Until now, I have been able to launch H from G by using
Intent intent = getPackageManager().getLaunchIntentForPackage("com.xxx.h");
startActivity(intent);
This has been working great, but in reality, I don't really need the H app to launch, I just need to do something with that app in the background, so I started looking into services. So now I am trying to use
Intent intent = new Intent();
intent.setClassName("com.xxx.h","com.xxx.h.MyService");
startService(intent);
But now I am getting the error saying
W/ActivityManager(1044): Unable to start service Intent { cmp=com.xxx.h/.MyService } U=0: not found
Very new to Services and even Intents so I am guessing it is something simple that I am missing and hoping you guys can help.
EDIT
I fixed the issue with is saying that I was unable to start service intent. That was fixed by including
service android:name=".MyService"
to the AndoirdManifest.xml in H. Now I am getting
E/AndroidRuntime(1022): java.lang.IllegalStateException: Could not execute method of the activity
EDIT 2
Found out it was not letting me start without permission so I had to include android:exported="true" in the AndroidManifest.xml as well