I'm writing an app that sets an alarm, and here's the relevant code that's causing a force close:
Intent i = new Intent(AlarmClock.ACTION_SET_ALARM);
i.putExtra(AlarmClock.EXTRA_HOUR, hours);
i.putExtra(AlarmClock.EXTRA_MINUTES, minutes);
i.putExtra(AlarmClock.EXTRA_SKIP_UI, true);
startActivity(i);
The startActivity(i)
is causing the force close. I tried catching ActivityNotFoundException
and displaying a Toast, but the force close is still happening.
I'm really new to Android programming, and I'm starting to think there are other forces at work here... does the manifest file need to be edited to account for Activities not native to this application (such as the Alarm Clock) that this application tries to start?
EDIT: I should have mentioned, I'm using Android 2.3.5 (API level 10).