Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Problem loading calendar module

$
0
0

Hi I am quite new to titanium. I am trying to implement a calendar module but somehow it doesn't seems to work. Can anyone help me to resolve this issue?

// Example of how to use to create an intent that was not possible with base Titanium sdk
// open a single window
var win = Ti.UI.createWindow({
    backgroundColor : 'white'
});
var label = Ti.UI.createLabel();
win.add(label);
win.open();
 
var improvedintent = require('com.electionsoft.improvedintent');
Ti.API.info("module is => " + improvedintent);
 
label.text = 'This view should launch an intent to create a new calendar event on newer android devices';
 
if (Ti.Platform.name == "android") {
    var intent = ii.createImprovedIntent({
        data : 'content://com.android.calendar/events',
        action : Ti.Android.ACTION_INSERT
    });
    var end = new Date();
    end.setHours(end.getHours() + 5);
    intent.putExtra('title', 'Awesome event');
    intent.putLongExtra('beginTime', new Date().getTime());
    intent.putLongExtra('endTime', end.getTime());
    intent.putExtra('allDay', false);
    intent.putExtra('eventLocation', '123 Street Rd.\nCity, ST 12345');
    intent.putExtra('description', 'Awesome event is awesome!');
    try {
        Ti.Android.currentActivity.startActivity(intent);
    } catch (e) {
        alert('Calendar not supported');
    }
}
 
    return win;
}
 
//make constructor function the public component interface
module.exports = ApplicationWindow;
Here is my Project directory:http://postimg.org/image/jkv88wj4z/

Here is the runtime error:http://postimg.org/image/iqyjqpzn5/


Viewing all articles
Browse latest Browse all 8068

Trending Articles