Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to start service Intent
    text
    copied!<p>I've read probably 100 questions and answers on this issue, but I cant seem to get this working. I'm trying to start a <code>Service</code> from an <code>Activity</code>. My manifest file seems OK, the way I'm starting the <code>Service</code> also seems to be correct. The following error is showing up in LogCat:</p> <pre><code>ActivityManager(1296): Unable to start service Intent { cmp=com.exercise.AndroidClient/com.client.Communication }: not found </code></pre> <p>I'm attempting to start the service by calling this in my <code>Activity</code>:</p> <pre><code>startService(new Intent(getApplicationContext(), Communication.class)); </code></pre> <p>The <code>Service</code> is the following:</p> <pre><code>public class Communication extends Service { public Communication() { super(); } @Override public void onCreate() { super.onCreate(); Log.i("Service", "Created service"); } @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.i("Service", "onStartCommand called"); return START_STICKY; } @Override public IBinder onBind(Intent arg0) { return null; } } </code></pre> <p>The entry in my manifest file is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.exercise.AndroidClient" android:versionCode="1" android:versionName="1.0"&gt; &lt;application android:icon="@drawable/sms" android:label="@string/app_name" &gt; &lt;activity&gt; ... &lt;/activity&gt; &lt;service android:enabled="true" android:name=".Communication" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Any advice is greatly appriciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload