title: How to show Notifications after every 4 hours?
body: <p><em>I want the notification to be shown after every 4 hours after the Activity is Destroyed.</em></p>
  
  <p><strong>Here's my code snippet of main activity's onDestroy().</strong></p>
  
  <pre><code>@Override
      protected void onDestroy() {
  
      Intent notificationIntent = new Intent(this, Notification.class);
      PendingIntent contentIntent = PendingIntent.getService(this, 0, notificationIntent,
                                                                         PendingIntent.FLAG_CANCEL_CURRENT);
  
      AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      am.cancel(contentIntent);
      am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, System.currentTimeMillis(), 1000*00*00*04, contentIntent);
  }
  </code></pre>
  
  <p><strong>and here is my Notification.class code snippet:</strong></p>
  
  <pre><code>import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.app.Service;
  import android.content.Context;
  import android.content.Intent;
  import android.media.RingtoneManager;
  import android.os.IBinder;
  import android.support.v4.app.NotificationCompat;
  
  public class Notification extends Service {
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          Intent mainIntent = new Intent(this, Main.class);
  
          NotificationManager notificationManager
              = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
  
          android.app.Notification noti = new NotificationCompat.Builder(this)
              .setAutoCancel(true)
              .setContentIntent(PendingIntent.getActivity(this, 0, mainIntent,
                                PendingIntent.FLAG_UPDATE_CURRENT))
              .setContentTitle("Title")
              .setContentText("It's been so Long!!!")
              .setSubText("Please return back to App")
              .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
              .setVibrate(new long[] {1000,1000,1000,1000})
              .setSmallIcon(R.drawable.ic_launcher)
              .setTicker("Important Notification")
              .setWhen(System.currentTimeMillis())
              .build();
  
          notificationManager.notify(0, noti);
      }
  
      @Override
      public IBinder onBind(Intent arg0) {
          // TODO Auto-generated method stub
          return null;
      }
  }
  </code></pre>
  
  <p>I am working on this since so many days but I am unable to complete the task.</p>
  
  <p>Any Help would be highly Appreciated.</p>
  
  <p>Thanks in Advance!</p>
  
  <p><strong><em>HELP please!!!</em></strong></p>