title: Unable to start service Intent { flg=0x4 cmp=com.org.sample/.TipActivity (has extras) } U=0: not found
body: <p>I know lots of people got this issue, but I tried all stack overflow suggestions.</p>
  
  <ol>
  <li><p>Making Package name small</p></li>
  <li><p>Verifying service in Manifest and more but still I am not able to resolve this.</p></li>
  <li><p>Application clean and build.</p></li>
  </ol>
  
  <p>But nothing worked. Onclicking startservice button, the service started, alarm set and intent not invoking. Getting unable to start service intent.</p>
  
  <p>Here is my code.</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      Button btnStartService;
      Button btnStopService;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          btnStartService = (Button)findViewById(R.id.btn_startService);
          btnStopService = (Button)findViewById(R.id.btn_stopService);
  
          btnStartService.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  startService();
              }
          });
  
          btnStopService.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  stopService();
              }
          });
      }
  
      // Method to start the service
      public void startService() {
          startService(new Intent(getBaseContext(), Backgroundservice.class));
      }
  
      // Method to stop the service
      public void stopService() {
          stopService(new Intent(getBaseContext(), Backgroundservice.class));
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>Background Service</p>
  
  <pre><code>public class Backgroundservice extends Service {
  
      private AlarmManager alarmManager;
      private PendingIntent pendingIntent;
  
      public Backgroundservice() {
      }
  
      @Override
      public IBinder onBind(Intent intent) {
          // TODO: Return the communication channel to the service.
          throw new UnsupportedOperationException("Not yet implemented");
      }
  
      @Override
        public int onStartCommand(Intent intent, int flags, int startId) {
          Toast.makeText(this, "Service Started!", Toast.LENGTH_LONG).show();
          DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
          Date date = new Date();
          System.out.println("*****" + dateFormat.format(date));
          startAlarm();
          return START_STICKY;
      }
  
      @Override
      public void onDestroy() {
          super.onDestroy();
          stopAlarm();
          Toast.makeText(this,"Service Stopped!",Toast.LENGTH_LONG).show();
      }
  
      public void startAlarm()
      {
          Calendar calendar = Calendar.getInstance();
          calendar.setTimeInMillis(System.currentTimeMillis());
          calendar.set(calendar.HOUR_OF_DAY,13);
          calendar.set(calendar.MINUTE,20);
          calendar.set(Calendar.SECOND,10);
  
          alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
          Intent intent = new Intent(this,TipActivity.class);
          pendingIntent = PendingIntent.getService(this,0, intent, 0);
  
          alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
          Toast.makeText(this, "Alarm Set", Toast.LENGTH_SHORT).show();
      }
  
      public void stopAlarm(){
  
          if (alarmManager != null)
          {
              alarmManager.cancel(pendingIntent);
              Toast.makeText(this, "Alarm Cancelled", Toast.LENGTH_SHORT).show();
          }
      }
  
  }
  </code></pre>
  
  <p>TipActivity,java</p>
  
  <pre><code>public class TipActivity extends AppCompatActivity {
  
      Button btnDismiss;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_tip);
  
          btnDismiss = (Button) findViewById(R.id.dismiss);
  
          btnDismiss.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  finish();
              }
          });
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_tip, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>AndroidManifest.xml</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.org.sample" &gt;
  
      &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:name=".Backgroundservice"
              android:enabled="true"
              android:exported="true" &gt;
          &lt;/service&gt;
  
          &lt;activity
              android:name=".TipActivity"
              android:label="@string/title_activity_tip"
              &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I worked alot on this to solve the issue but in vain.</p>
  
  <p>Your help is really appreciated.</p>