 <p>Change this </p> <pre><code>Integer i = (Integer) spinner_snooze.getSelectedItem(); </code></pre> <p>to</p> <pre><code>Integer i = (Integer) parent.getSelectedItem(); </code></pre> <p>Plus add any default value as first item.Check if first item is selected,than do not do anything.</p> <p>insert a default value like " -- " and compare it by using </p> <pre><code>if(parent.getSelectedItem().compareTo(" -- ")== 0 { //Do Nothing } else { //Do your stuff here AlarmManager mAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Integer i = (Integer) spinner_snooze.getSelectedItem(); snoozeAlarm(i, mAlarmManager, context); // Toast.makeText(getApplicationContext(), x, Toast.LENGTH_LONG).show(); finish(); } </code></pre>