title: Using AlarmManager() to call a function
body: <p>This is my code but this calls my activity instead of a function i want ,this code runs under a function that is inturn made in a Service:</p>
  
  <pre><code>Intent intent = new Intent(this, abc.class);
          PendingIntent pi = PendingIntent.getService(Server.this, 0, intent, 0);
          AlarmManager almmgr = (AlarmManager) getSystemService(ALARM_SERVICE);
          Calendar cldr = Calendar.getInstance();
          int min1 = cldr.get(Calendar.MINUTE);
          cldr.setTimeInMillis(System.currentTimeMillis());
          cldr.add(Calendar.SECOND, 30);
          almmgr.set(AlarmManager.RTC_WAKEUP, cldr.getTimeInMillis(), pi);
  </code></pre>
  
  <p>basically I would like to take inputs from 2 timepickers and when the difference of times between these 2 is achieved then call a function which does some control stuff!</p>