Android Question Calendar2 v1.13 Cannot locate

mtechteam

Member
Licensed User
Longtime User
Can someone help me locate the 1.13 version of Calendar2? I see that version listed in the documentation, but the latest version posted on the forum entry when searching calendar2 is v1.12.

Specifically I am experiencing a problem editing a calendar event. the error is: java.lang.IllegalArgumentException: Cannot have both DTEND and DURATION in an event

Internet searches indicate that this may be a defect that was corrected (android lib). I was wondering if a new version of the B4a library might take care of the issue.

Thanks,
Dan
 

mtechteam

Member
Licensed User
Longtime User
Thank you. Unfortunately it didn't fix my issue, but I did discover that it is only a problem on some Android 4 versions, no issues on newer versions. The error only happens on a Droid Ultra Android version 4.4.4. I'm OK with just saying it needs to be newer, but if anyone is interested here is the dump from the error:

java.lang.IllegalArgumentException: Cannot have both DTEND and DURATION in an event
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.update(ContentProviderNative.java:560)
at android.content.ContentResolver.update(ContentResolver.java:1364)
at edsmith.calendar.Calendar.UpdateEvent(Calendar.java:3121)
at org.techteam.mst.calendar._modifycalendarevent(calendar.java:285)
at org.techteam.mst.mstcalls._editcommhistory(mstcalls.java:4861)
at org.techteam.mst.categoryview._btnconfirmedit_click(categoryview.java:2737)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4466)
at android.view.View$PerformClick.run(View.java:18542)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Unfortunately it didn't fix my issue
We can not guess what you are doing or if the Library is working wrong. But without knowing the code you are using it is hard to help.
java.lang.IllegalArgumentException: Cannot have both DTEND and DURATION in an event
What did you tried to resolve this?
If you are setting an Duration then you should not set an EndDate. If you set an enddate then you can not use a Duration.
 
Upvote 0

mtechteam

Member
Licensed User
Longtime User
I'm confused with the error, because the only property in CalendarEvent is EndDate. I don't see a way to set a duration.

Here is the B4i code:

store.Initialize("store")
If store.AuthorizationStatusEvents = store.AUTHORIZATION_AUTHORIZED Then
Dim ev As CalendarEvent = store.GetEvent(EventID)
ev.Title = EventName
ev.StartDate = eventDate.TotalSeconds
ev.EndDate = eventDate.TotalSeconds + duration * 1000
ev.AllDay = AllDay
If pLocation <> "" Then
ev.Location = pLocation
End If

If reminder <> 0 Then
Dim alarm As CalendarAlarm
alarm.InitializeRelative(reminder / 60)
ev.AddAlarm(alarm)
End If
Dim no As NativeObject = ev
no.SetField("notes", pDesc)

store.SaveEvent(ev, False)
 
Upvote 0
Top