title: Eternal reminder service
body: <p>I make reminder in my app. User can set time for reminder. How to make eternal service, who will check device time and if it equal user set time - output the notification. I try like this, but it work few times and die. What have I done wrong?</p>
  
  <pre><code>void redinder2() {    
  
  for (int i = 1; i&lt;=10; i++) {
  
    Calendar calendar = Calendar.getInstance();    
    hour = calendar.get(Calendar.HOUR_OF_DAY);
    minute = calendar.get(Calendar.MINUTE);   
  
    if(hour==my_hour&amp;&amp;minute==my_minyte){){    sendNotif();}      
  
        if(i==10){startService(new Intent(this, MyService.class));}
            try {
              TimeUnit.SECONDS.sleep(59);
            } catch (InterruptedException e) {
              e.printStackTrace();
            }
  }
  </code></pre>
  
  <p>}</p>