title: startService after startActivity freezes my android application
body: <p>I have the below code which freezes after the application has navigated from one activity to another. I checked my logcat for any errors but there is none. Could you please help me out with the solution? Thanks. </p>
  
  <p>My service class</p>
  
  <pre><code>public class MyAlarmService extends Service
  {
  private Timer timer1 = new Timer();
  private Timer timer2 = new Timer();
  
  private static final long UPDATE_INTERVAL = 25000;
  
  @Override
  public IBinder onBind(Intent arg0) {
      // TODO Auto-generated method stub
      return null;
  }
  
  @Override
  public void onCreate() {
      // TODO Auto-generated method stub
      super.onCreate();
      _startService();
  
  }
  
  private void _startService() {
      timer1.scheduleAtFixedRate(new TimerTask() {
          public void run() {
              System.out.println("Timer started1");
              Leavenotification(MyAlarmService.this);
              Timesheetnotification(MyAlarmService.this); 
          }
      }, 0, UPDATE_INTERVAL);
  }
  
  @Override
  public void onStart(Intent intent, int startId) {
      super.onStart(intent, startId);
  }
  
  @Override
  public void onDestroy() {
      // TODO Auto-generated method stub
      super.onDestroy();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>this is how I am starting the service and activity</p>
  
  <pre><code>                    Intent intent = new Intent(this, Dashboard.class);
                      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                      intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                      intent.putExtra("userID", userID);
                      intent.putExtra("name", name);
                      startActivity(intent);
                      startService(new Intent(this,MyAlarmService.class);
  </code></pre>
  
  <p>I am not sure what is wrong here. </p>