Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
vijaysaini
Posts: 72
Registered: ‎08-28-2008

Calendar issue???

Hi All,
i have written a sample app that add custom menu item in native calendar app. On custom menu item click, one event/appointment gets created by my app. when i run this app on blackberry software version 4.5 then i see below mentioned behavior

when i open native calendar app with my non-default calendar and hits the custom menu item then events get created and when i click on newly created appointment from non-default/Main calendar. then it shows me a alert message that "Appointment deleted externally. Changes will be lost and the viewer closed.". And one more thing that when i try to deleted that appointment, then nothing happens.

So, my question are,
1: why i am not able to open this events/appointments?
2: why these appointments/events gets created in non-default calendar?

i was thinking, it might be a possibility that my calendar database gets corrupted so, i wiped my device and tried the app again but i am still getting the issue.

Can anyone help me on this

Thanks in advance
Regards,
Vijay Saini.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
New Developer
vijaysaini
Posts: 72
Registered: ‎08-28-2008

Re: Calendar issue???

My Device detail

device Modal : 8820

Software version : v4.5.0.37(Platform 2.7.0.55)

Regards,
Vijay Saini.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Calendar issue???

Can you provide a code snippet of what you are doing inside the ApplicationMenuItem?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
vijaysaini
Posts: 72
Registered: ‎08-28-2008

Re: Calendar issue???

Hi, 

 

please find below the code of ApplicationMenuItem

 

class CustomEventMenuItem extends ApplicationMenuItem
{
    public CustomEventMenuItem()
    {
        super(20);
    }
   
    public Object run(Object context)
    {
        EventList eventList = null;
    try
    {
        eventList = (EventList) PIM.getInstance().openPIMList( PIM.EVENT_LIST , PIM.READ_WRITE );
    }
    catch( PIMException e )
    {
        Dialog.alert("EVENT_LIST could not be opened : "+e.toString());               
    }

    if(eventList != null)
    {
        try
        {
        BlackBerryEvent blackBerryEvent= (BlackBerryEvent)eventList.createEvent();
        // add title
        if ( eventList.isSupportedField( BlackBerryEvent.SUMMARY ) ) blackBerryEvent.addString( BlackBerryEvent.SUMMARY, 0, "HELLO "+System.currentTimeMillis() );
        long start = System.currentTimeMillis();
        long end = start + 600000;
        if (eventList.isSupportedField( BlackBerryEvent.START ) ) blackBerryEvent.addDate( BlackBerryEvent.START, 0, start );
        if (eventList.isSupportedField( BlackBerryEvent.END ) ) blackBerryEvent.addDate( BlackBerryEvent.END, 0, end );
        blackBerryEvent.commit();
        Dialog.alert("Calendar event created successfully.");
        }
        catch(Exception ex)
        {
        Dialog.alert("{Warm } ; "+ ex.toString());
        }
    }
        return null;
    }
   
    public String toString()
    {
        return "Demo Create";
    }
}

Regards,
Vijay Saini.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Calendar issue???

I was able to reproduce this issue and have forwarded it to our development team.  I do not have a work around to offer for this issue.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.