Why AlarmMAnager Is Not Working?
<p>I am calling a service class  from broadcastReciever My Class is As:-</p>

<pre><code>InsertIntoDB objinsert;
ArrayList&lt;ContactClass&gt; resultList;
ContactClass mContactClass =null;

public ScheduleService() {

     super("B'Day Checker Service");


}

@Override
protected void onHandleIntent(Intent intent)
  { 
    objinsert = new InsertIntoDB(this);
    Log.d("MyService", "About to execute MyTask");
    new MyTask().execute();

     }

private class MyTask extends AsyncTask&lt;Void, Void, ArrayList&lt;ContactClass&gt;&gt; 
   {

    @Override
    protected void onPreExecute() {

        super.onPreExecute();
         mContactClass = new ContactClass();
         resultList= new ArrayList&lt;ContactClass&gt;();
    }

    @Override
    protected ArrayList&lt;ContactClass&gt; doInBackground(Void... arg0)
    {
        List&lt;ContactClass&gt; contacts = objinsert.getAllContacts();
        for (ContactClass cn : contacts)
        {
            String mdob =  cn.getDob();
            long output = dateCompare(mdob);
            if(output==0)
            {
                mContactClass.setId(cn.getId());
                mContactClass.setName(cn.getName());
                mContactClass.setDob(cn.getDob());
                resultList.add(mContactClass);
            }

              Log.d("Name: ",""+resultList.size());
        }
        return resultList;
    }

    @Override
    protected void onPostExecute(ArrayList&lt;ContactClass&gt; result) {

        super.onPostExecute(result);
        System.out.println("posttttt");
        int length=0;
        if(result!=null)
        {
         length = result.size();
        }
        if(length!=0)
        {
            for(int mindex =0;mindex&lt;length;mindex++)
            {
                String date = result.get(mindex).getDob();
                String[] arrdob =date.split("/");
                Calendar cal = Calendar.getInstance();
                cal.setTimeInMillis(System.currentTimeMillis());
                cal.clear();
                cal.set(Integer.parseInt(arrdob[2]), Integer.parseInt(arrdob[1])-1,Integer.parseInt(arrdob[0]),14,17);

                AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
                 Intent intent = new Intent(ScheduleService.this, BirthDayReciever.class);
                 PendingIntent pendingIntent = PendingIntent.getBroadcast(ScheduleService.this, 0, intent, 0);
                 //cal.add(Calendar.SECOND, 5);
                 alarmMgr.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent);
            }
        }


    }



}


public long dateCompare(String date)
 {
    System.out.println("date---"+date);
    String geivendate[] = date.split("/");
    int Day= Integer.parseInt(geivendate[0]);
    int Month= Integer.parseInt(geivendate[1]);
    int Year= Integer.parseInt(geivendate[2]);

    Date currentdate = new Date();
    Calendar calUpdated = Calendar.getInstance();
    calUpdated.set(Year, Month-1, Day);

    long updateDateMilliSec = calUpdated.getTimeInMillis();
    long diff = currentdate.getTime() - calUpdated.getTimeInMillis();
    long diffDays = (diff / (1000 * 60 * 60 * 24));

    return diffDays;
 }
</code></pre>

<p>But It is Not Working doinBackground method is running after that an exception in logcat not application crash only in logcat is as:-</p>

<pre><code>07-11 14:16:34.444: W/MessageQueue(942): Handler{44f6ad40} sending message to a Handler on a dead thread
07-11 14:16:34.444: W/MessageQueue(942): java.lang.RuntimeException: Handler{44f6ad40} sending message to a Handler on a dead thread
07-11 14:16:34.444: W/MessageQueue(942):    at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179)
07-11 14:16:34.444: W/MessageQueue(942):    at android.os.Handler.sendMessageAtTime(Handler.java:457)
07-11 14:16:34.444: W/MessageQueue(942):    at          android.os.Handler.sendMessageDelayed(Handler.java:430)
07-11 14:16:34.444: W/MessageQueue(942):    at android.os.Handler.sendMessage(Handler.java:367)
07-11 14:16:34.444: W/MessageQueue(942):    at android.os.Message.sendToTarget(Message.java:348)
07-11 14:16:34.444: W/MessageQueue(942):    at android.os.AsyncTask$3.done(AsyncTask.java:214)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.FutureTask$Sync.innerSet(FutureTask.java:252)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.FutureTask.set(FutureTask.java:112)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:310)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
07-11 14:16:34.444: W/MessageQueue(942):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
07-11 14:16:34.444: W/MessageQueue(942):    at java.lang.Thread.run(Thread.java:1096)
</code></pre>

<p>anyone suggest me where I am wrong thanks in extra....</p>
