title: Why my notification doesn't work?
body: <p>I put here my code...
  I explain my problem..
  when I create a notification, it appears to me immediately even if I enter a specific time to make it appear. 
  at that time instead opens automatically as if i push on notification. 
  can you tell me how I can play it at the time that i inserted? </p>
  
  <p>thanks</p>
  
  <pre><code>import java.util.Calendar;
  import java.util.StringTokenizer;
  import android.app.AlarmManager;
  import android.app.Notification;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.net.Uri;
  import android.support.v4.app.NotificationCompat;
  
  public class Allarm {
  
  private Context context;
  
  public Allarm(Context context) {
          this.context = context;
      }
  
      public void createAlarm(String rip,String title,String object,String dati) {
  
  
          String day= "01";
          String month= "01";
          String year= "2014";
          String hour= "00";
          String minute = "02";
  String date = day+"/"+month+"/"+year+" "+hour+":"+minute; 
  
          Calendar myAlarmDate = Calendar.getInstance();
          myAlarmDate.setTimeInMillis(System.currentTimeMillis());
          myAlarmDate.set(Integer.valueOf(year), Integer.valueOf(month),
                  Integer.valueOf(day), Integer.valueOf(hour),
                  Integer.valueOf(minute), 0);
  
          AlarmManager alarmManager = (AlarmManager) context
                  .getSystemService(Context.ALARM_SERVICE);
  
          Intent intent =new Intent(context, NotificationReceiverActivity.class);
  
          intent.putExtra("dati", dati);
  
          intent.setData(Uri.parse("content://"+date));
  
          PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
  
    NotificationManager notificationManager =(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 
  
          NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(
                  context)
                  .setWhen(myAlarmDate.getTimeInMillis())
                  .setContentText(object)
                  .setContentTitle(title)
                  .setSmallIcon(R.drawable.avvio)
                  .setAutoCancel(true)
                  .setTicker(title)
                  .setDefaults(Notification.DEFAULT_LIGHTS| Notification.DEFAULT_VIBRATE| Notification.DEFAULT_SOUND)
                  .setContentIntent(pendingIntent);
  
  
                  Notification notification=notificationBuilder.build();
  
                  alarmManager.set(AlarmManager.RTC_WAKEUP,
                  myAlarmDate.getTimeInMillis(), pendingIntent);
                  notificationManager.notify((int) myAlarmDate.getTimeInMillis(), notification);
  
      }
  
  
  
  
  }
  </code></pre>