I am writing an application that sets an alarm, and here is the corresponding code that causes the force:
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);
startActivity(i)causes force. I tried to catch ActivityNotFoundExceptionand show Toast, but the closing force is still happening.
I'm really new to Android programming, and I'm starting to think that other forces work here ... do I need to edit the manifest file to take into account actions that are not native to this application (for example, Alarm Clock) that tries to run this application?
EDIT: I should have mentioned, I am using Android 2.3.5 (API level 10).
source
share