小编use*_*310的帖子

将事件添加到android日历但没有提示(没有弹出窗口)

我有以下代码可行.

但我不希望确认出现

希望它自动在日历上输入活动

有人有个建议

calIntent.addFlags(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);
                    calIntent.setType("vnd.android.cursor.item/event");    
                    calIntent.putExtra(Events.TITLE, "SMS: "+contact); 
                    calIntent.putExtra(Events.EVENT_LOCATION, ""); 
                    calIntent.putExtra(Events.DESCRIPTION, msgBody); 
                    calIntent.putExtra(Events.HAS_ALARM, 0);
                    calIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, false); 
                    calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, System.currentTimeMillis()); 
                    calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, System.currentTimeMillis()+1); 
                    context.startActivity(calIntent);     
Run Code Online (Sandbox Code Playgroud)

events android calendar

1
推荐指数
1
解决办法
2589
查看次数

标签 统计

android ×1

calendar ×1

events ×1