Schedule an event using AlarmManager with ELAPSED_REALTIME
<p>I have a question on scheduling an event using AlarmManager with ELAPSED_REALTIME.
I want to schedule an intent after 30 minutes except sleeping time. Which of the following code I should use?</p>

<p>Code 1:</p>

<pre><code>AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.ELAPSED_REALTIME,
                    30000, myIntent);
</code></pre>

<p>Code 2:</p>

<pre><code>AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.ELAPSED_REALTIME,
                    SystemClock.elapsedRealtime() + 30000, myIntent);
</code></pre>

<p>Thanks.</p>
