|
|
@ -31,6 +31,8 @@ import android.text.TextUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.preference.PreferenceManager;
|
|
|
|
import androidx.preference.PreferenceManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
@ -104,6 +106,23 @@ public class CalendarHelper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Long insert(Context context, ICalendar icalendar, VEvent event, int status,
|
|
|
|
|
|
|
|
EntityAccount account, EntityMessage message) {
|
|
|
|
|
|
|
|
String selectedAccount;
|
|
|
|
|
|
|
|
String selectedName;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
JSONObject jselected = new JSONObject(account.calendar);
|
|
|
|
|
|
|
|
selectedAccount = jselected.getString("account");
|
|
|
|
|
|
|
|
selectedName = jselected.optString("name", null);
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.i(ex);
|
|
|
|
|
|
|
|
selectedAccount = account.calendar;
|
|
|
|
|
|
|
|
selectedName = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return insert(context, icalendar, event, status, selectedAccount, selectedName, message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Long insert(Context context, ICalendar icalendar, VEvent event, int status,
|
|
|
|
static Long insert(Context context, ICalendar icalendar, VEvent event, int status,
|
|
|
|
String selectedAccount, String selectedName, EntityMessage message) {
|
|
|
|
String selectedAccount, String selectedName, EntityMessage message) {
|
|
|
|
Long existId = null;
|
|
|
|
Long existId = null;
|
|
|
|