title: ActivityNotFoundException: Unable to find explicit activity class service
body: <p>This is how my MainActivity and RecorderService Java class files looks like. I'm adding the AndroidManifest file too. </p>
  
  <p><strong>MainAcitivity.java</strong></p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
  
        btnSendSOS.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  sendSMS();
  
                  Intent intent = new Intent(getBaseContext(), RecorderService.class);
                  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  startActivity(intent);
  
                  finish();
  
                  new CountDownTimer(5000, 1000) {
  
                  @Override
                  public void onTick(long millisUntilFinished) {
  
                  }
  
                  @Override
                  public void onFinish() {
                      stopService(new Intent(getApplicationContext(), RecorderService.class));
                  }
              }.start();
        });
  
  
  }
  </code></pre>
  
  <p><strong>RecorderService.java</strong></p>
  
  <pre><code>public class RecorderService extends Service {
       // Service code here
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;service android:enabled="true"
              android:name=".RecorderService" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>I have added the service to the Manifest file. But still I'm getting the error: <code>android.content.ActivityNotFoundException: Unable to find explicit activity class {.RecorderService}; have you declared this activity in your AndroidManifest.xml?</code></p>
  
  <p>Please help me out. Thanks in advance</p>