When executed the function AddEventOther Function
Error:
'Android.android.provider.CalendarContractDLREventsColumns:Include' cannot be expanded because the entity has been stripped
using Uno;
using Uno.Collections;
using Fuse;
using Fuse.Scripting;
using Fuse.Reactive;
using global::Android.android.media;
using global::Android.android.app;
using global::Android.android.provider;
using global::Android.android.provider;
using global::Android.android.content;
using global::Android.java.util;
public class SystemSounds : NativeModule
{
public SystemSounds()
{
AddMember(new NativeFunction("playNotification",(NativeCallback)PlayNotification));
AddMember(new NativeFunction("playSound",(NativeCallback)PlaySound));
AddMember(new NativeFunction("addEvent",(NativeCallback)AddEvent));
AddMember(new NativeFunction("addEventOther",(NativeCallback)AddEventOther));
}
object mNotification;
object mNotifyManager;
extern(Android)
public void NotifyIt() {
debug_log("In Function NotifyIt");
var id = 1;
NotificationDLRBuilder notification = mNotification as NotificationDLRBuilder;
NotificationManager notifyManager = mNotifyManager as NotificationManager;
notifyManager.notify(id, notification.build() );
}
object PlayNotification(Fuse.Scripting.Context c, object[] args)
{
debug_log("In Function PlayNotification");
if defined(Android)
{
NotificationDLRBuilder notification = mNotification as NotificationDLRBuilder;
NotificationManager notifyManager = mNotifyManager as NotificationManager;
var context = Activity.GetAppActivity().getApplication().getApplicationContext();
notifyManager = (NotificationManager) Activity.GetAppActivity().getSystemService(Android.android.content.Context.NOTIFICATION_SERVICE);
notification = new NotificationDLRBuilder(context);
Android.java.lang.String title = "Test Notification";
Android.java.lang.String subTitle = "Jai Mahadev...";
notification.setContentTitle(title);
notification.setContentText(subTitle);
int resID = context.getResources().getIdentifier("icon" , "drawable", context.getPackageName());
notification.setSmallIcon(resID);
mNotification = notification;
mNotifyManager = notifyManager;
UpdateManager.PostAction( NotifyIt);
}
return null;
}
object PlaySound(Fuse.Scripting.Context c, object[] args)
{
if defined(Android)
{
var uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
var ringtone = RingtoneManager.getRingtone(Activity.GetAppActivity(), uri);
ringtone.play();
}
debug_log("Sound played!");
return null;
}
object mIntent;
object mContext;
extern(Android)
public void ActivityStart() {
Android.android.content.Intent intent = mIntent as Android.android.content.Intent;
Android.android.content.Context context = mContext as Android.android.content.Context;
context.startActivity(intent);
}
object AddEvent(Fuse.Scripting.Context c,object[] args)
{
debug_log("Inside Add Event");
if defined(Android){
Android.java.util.Calendar cal = Android.java.util.Calendar.getInstance();
Android.android.content.Intent intent = new Android.android.content.Intent(Android.android.content.Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", cal.getTimeInMillis());
intent.putExtra("allDay", true);
intent.putExtra("rrule", "FREQ=YEARLY");
intent.putExtra("endTime", cal.getTimeInMillis()+60601000);
intent.putExtra("title", "A Test Event from android app");
intent.setFlags(Android.android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
mIntent = intent;
mContext = Activity.GetAppActivity().getApplication().getApplicationContext();
UpdateManager.PostAction(ActivityStart);
}
return null;
}
object AddEventOther(Fuse.Scripting.Context c,object[] args)
{
debug_log("Inside Add Event");
if defined(Android){
long calID = 3;
long startMillis = 0;
long endMillis = 0;
Android.java.util.Calendar calBegin = Android.java.util.Calendar.getInstance();
calBegin.set(2016,1,26,9,30);
startMillis = calBegin.getTimeInMillis();
Android.java.util.Calendar calEnd = Android.java.util.Calendar.getInstance();
calEnd.set(2016,1,26,10,30);
endMillis = calEnd.getTimeInMillis();
Android.java.util.TimeZone tz = Android.java.util.TimeZone.getDefault();
Android.android.content.ContentResolver cr = Activity.GetAppActivity().getApplication().getApplicationContext().getContentResolver();
Android.android.content.ContentValues values = new Android.android.content.ContentValues();
values.put(Android.android.provider.ICalendarContractDLREventsColumns.DTSTART, startMillis);
values.put(Android.android.provider.ICalendarContractDLREventsColumns.DTEND, endMillis);
values.put(Android.android.provider.ICalendarContractDLREventsColumns.TITLE, "Title of the Event");
values.put(Android.android.provider.ICalendarContractDLREventsColumns.DESCRIPTION, "Title of the Event");
values.put(Android.android.provider.ICalendarContractDLREventsColumns.CALENDAR_ID, calID);
values.put(Android.android.provider.ICalendarContractDLREventsColumns.EVENT_TIMEZONE, tz.getID());
}
return null;
}
}
Any idea why this is happening?