How to do scheduling in android?
<p>I am trying to create a scheduler app in android in which i want to run app in background daily on an specified time.Below is the code but this is not working for me Please suggest</p>

<pre><code>  private void setAlarm(String targetCal){
    String[] Time=targetCal.split(":");
    Intent intent = new Intent(getBaseContext(), AlarmReceiver.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(getBaseContext(), RQS_1, intent, 0);
    AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
    Calendar timeOff = Calendar.getInstance();
    //int days = Calendar.SUNDAY + (7 - timeOff.get(Calendar.DAY_OF_WEEK)); // how many days until Sunday
    timeOff.set(Calendar.HOUR,Integer.valueOf(Time[0]));
    timeOff.set(Calendar.MINUTE,Integer.valueOf(Time[1]));
    timeOff.set(Calendar.SECOND, 00);
    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, timeOff.getTimeInMillis(), 24*60*60*1000 , pendingIntent);

}
</code></pre>
