Android calls the calendar reminder, but the alarm clock cannot be turned on, to solve,

Android calls the calendar reminder, and the alarm clock cannot be turned on. The solution,
the calendar insertion reminder, involves three tables Events, Reminders, and ExtendedProperties. Among them, hasAlarm in events seems to have been abandoned by domestic mobile phones, but it is safe to add it, but the most important thing The third table is ExtendedProperties. As the name suggests, this is called extended properties, that is, the fields in the previous two tables are not enough, so this is used, so the value field of this table is completely controlled by us, and many fields can be passed in. We need to insert the string "{"need_alarm":true}" into the value field. It may be that the current Android phone is dissatisfied with the hasAlarm field given by Google, or it is difficult to meet the demand. In fact, the value field A long json string in map key-value pair format can be inserted to store various parameters.

extendedProperties.put(CalendarContract.ExtendedProperties.VALUE,"{\"need_alarm\":true}");

Android Xiaomi realizes inserting calendar alarm clock reminder

Everyone pay attention, if you have any questions, you can comment below or private message me, I will answer unconditionally, you can also download the source code, no points are required at present, the source code is a tool class related to calendar operation, which includes creating a new calendar account, checking the calendar Whether the account already exists, adding reminder events, adding alarm clock events, deleting calendar events, and traversing and querying the contents of all columns and rows in the database table are very detailed. I have tested them with many Xiaomi Redmi phones and passed the source code download
.

Guess you like

Origin blog.csdn.net/Spy003/article/details/128888882