Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6895135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:52:12+00:00 2026-05-27T06:52:12+00:00

I try add an event to blackberry calendar. The following code is used: EventList

  • 0

I try add an event to blackberry calendar. The following code is used:

EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST,PIM.WRITE_ONLY);
    _event = eventList.createEvent();

        String subject = _subject.getText().trim();
        String location = _location.getText().trim();
        long startTime = _startTime.getDate();
        long endTime = _endTime.getDate();
        String description = _desc.getText().trim();

        if (subject.length() == 0 || location.length() == 0)
        {
            Dialog.inform("Subject and location required");
            return false;
        }

        if ( endTime <= startTime || startTime < System.currentTimeMillis())
        {
            Dialog.inform("Invalid Start/End times");
            return false;
        }

        _event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, subject );
        _event.addString(Event.LOCATION, PIMItem.ATTR_NONE, location);
        _event.addDate(Event.START, PIMItem.ATTR_NONE, startTime);
        _event.addDate(Event.END, PIMItem.ATTR_NONE, endTime);    
        _event.addString(Event.NOTE, PIMItem.ATTR_NONE, description);

        RepeatRule rule = new RepeatRule();


        switch(_recur.getSelectedIndex())
        {
            case 1:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.DAILY);
                break;

            case 2:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.WEEKLY);
                break;

            case 3:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.MONTHLY);
                break;

            case 4:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.YEARLY);
                break;        
        }


        _event.setRepeat(rule);


        _event.commit();

This code is taken from Blackberry Sample Application PIMDEMO

The error is :

The event added to the dates After the end date

Example:
If I set a event from 2011 Dec 1 (start date)to 2011 Dec 5(end date) Then the event shown in calendar from Dec 1 to all days after it(that is the event never ends).

I tested this code in simulator and BlackBerry pearl 9105.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:52:13+00:00Added an answer on May 27, 2026 at 6:52 am

    Remove the Following RepeatRule Code and try.

     RepeatRule rule = new RepeatRule();
    
    
        switch(_recur.getSelectedIndex())
        {
            case 1:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.DAILY);
                break;
    
            case 2:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.WEEKLY);
                break;
    
            case 3:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.MONTHLY);
                break;
    
            case 4:
                rule.setInt(RepeatRule.FREQUENCY,RepeatRule.YEARLY);
                break;        
        }
    
    
        _event.setRepeat(rule);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error: ReferenceError: setDynaTreeCustom is not defined add.js Code: ...... success: function(treeData){ try{ showPopup(Add Fields|,'multi_list','event',0,0,1);
I try to implement simple touch event handling on Blackberry 9550 emulator, but it
I try to add a module into the web.config from within an event-receiver. I
I try to add an event handler to a sprite object but it doesn't
When I try to delete a specific event from my calendar it returns NULL
got an ADOQuery that has OnNewRecord event. on the procedure i try to add
Good day. I try to add event to segment control, but it always take
At row level I catch the event and try to add an extra parameter
i try to add facebook like button on my root domain that will like
I try to add the android coverflow in my own android projet when myt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.