Android start service of an app from another android app

I have two applications installed on the device: from one app I want to start a service as follows:

Intent i = new Intent();
   i.setComponent(new ComponentName("com.app.service",    "com.app.service.NotificationService"));
  context.startService(i);

The second app is only installed but not started.

What I want is to start the notification service(which should create a notification) from the second service by using the above code.

In the manifest file of the second app I declare the service as follows:

<service
        android:name=".service.NotificationService"
        android:exported="true" />

The problem is that the Notification Service from the second app does not start.

Any ideas on why this happens?


Source: android

Leave a Reply