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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 72
Registered: ‎08-28-2008
My Device: Not Specified

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
New Developer
Posts: 72
Registered: ‎08-28-2008
My Device: Not Specified

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
BlackBerry Development Advisor
Posts: 15,888
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
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.
Highlighted
New Developer
Posts: 72
Registered: ‎08-28-2008
My Device: Not Specified

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
BlackBerry Development Advisor
Posts: 15,888
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
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.