I am using this for adding event to calendars
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
....
startActivity(intent);
But how would I know if there is no provider for event (like on the emulator). I do get a ActivityNotFoundException, but can it be found before launching the activity?
Use
PackageManagerandqueryIntentActivities(). If it returns an empty list, you know that astartActivity()on theIntentwill result in anActivityNotFoundException.