我是Android的新手,我的设备中有两个日历,而从我的应用程序添加到设备提示的事件显示日历与相应的包(com.android.calendar),谷歌日历(com.google.andriod.calendar) 。 但在S4中它完全显示为日历,而在摩托罗拉平板显示包装名称。我的要求是在所有设备中隐藏这些包名称。
if (!checkTheEvent()) {
try {
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra(CalendarContract.Events.TITLE, eventTitleData);
intent.putExtra(CalendarContract.Events.DESCRIPTION, description);
intent.putExtra(CalendarContract.Events.EVENT_LOCATION, bun_author);
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
convertMilliseconds(start_date_time));
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
convertMilliseconds(end_date_time));
startActivityForResult(intent, 200);
convertMilliseconds(end_date_time);
} catch (Exception e) {
e.printStackTrace();
AlertDialogUtil utils=new AlertDialogUtil(this, (AlertResponse) this);
utils.showDilaog(R.drawable.calendar_alert, "The Calendar Application is missing on this device.", "Warning", true);
}
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android.cursor.item/event");
// Android 2.2+
intent.setData(Uri.parse("content://content://com.android.calendar/events/"
+ String.valueOf(CustomCalendar.eventID.get(position))));
intent.putExtra("beginTime",
convertMilliseconds(start_date_time));
intent.putExtra("endTime", convertMilliseconds(end_date_time));
// Android 2.1 and below.
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivityForResult(intent, 200);
}