How to get aroung setting a unique id for alarm manager?
<p>I am using this code to launch an Alarm. </p>

<p>The alarm is set in an a activity that the user can launch.</p>

<pre><code>//Setting alarm to fire off NEW_GAME intent every 24 hours.
            String alarm = Context.ALARM_SERVICE;
            Calendar calendar = Calendar.getInstance();

            calendar.set(Calendar.HOUR_OF_DAY, 8);
            calendar.set(Calendar.MINUTE, 0);
            calendar.set(Calendar.SECOND,0);
            calendar.set(Calendar.MILLISECOND, 0);

             Log.i("Test", "Current time: " + System.currentTimeMillis() );
                Log.i("Test", "Calendar time: " + calendar.getTimeInMillis() );

                int currentDate = calendar.get(Calendar.DATE);
                calendar.set(Calendar.DATE, currentDate+1);

                Log.i("Test", "Calendar time with a day added: " + calendar.getTimeInMillis() );


            AlarmManager am = (AlarmManager)getActivity().getSystemService(alarm);
                Intent intent = new Intent("NEW_ITEM");
                PendingIntent sender = PendingIntent.getBroadcast(getActivity(), 0, intent, 0);

                am.setRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis() , AlarmManager.INTERVAL_DAY, sender);
</code></pre>

<p>I was told i need to supply a uniqu id so that the alarm doesnt over writte each other where getBroadcast() is. </p>

<p>The problem is how do i do this when the user can open the activity as many times as they want?</p>

<p>Also if i supply a unique id each time this means it could possibly set 5 of the same ALARMS because of the unique id's.</p>

<p>How or what is the best way to get around this?</p>
