Creation of all-day event that works for OS 4.2.1 4.5 device

I am trying to create all day calendar events using the following code snippet:

        protected void insertOneIntoCalendar(EventList el, DateField thisField) {

                if (el == null) {                        return;                }

                BlackBerryEvent bbe = (BlackBerryEvent) el.createEvent();

                if (bbe == null) {                        return;                }

                //                bbe.addString(Event.SUMMARY, 0, thisField.getLabel().substring(0, thisField.getLabel().length() - 1));

                //                bbe.addString(Event.NOTE, 0, thisField.getLabel() + " " + thisField.toString());

                bbe.addDate(Event.START, 0, thisField.getDate() + ltz.getRawOffset());                bbe.addDate(Event.END, 0, thisField.getDate() + ltz.getRawOffset());

                // Checks the Event List to determine if the ALLDAY field is supported                if(el.isSupportedField(BlackBerryEvent.ALLDAY)) {

                        // Checks the event to determine if ALLDAY attribute as already be set                        if (bbe.countValues(BlackBerryEvent.ALLDAY) > 0) {                                bbe.setBoolean(BlackBerryEvent.ALLDAY,0,Event.ATTR_NONE,true);                        } else {                                bbe.addBoolean(BlackBerryEvent.ALLDAY,Event.ATTR_NONE,true);                        }                } else {                        System.out.println("*** ALLDAY not supported");                }

                // Checks the Event List to determine if the FB_FREE field is supported                if(el.isSupportedField(BlackBerryEvent.FREE_BUSY)) {                        if (bbe.countValues(BlackBerryEvent.FREE_BUSY) > 0) {                                bbe.setInt(BlackBerryEvent.FREE_BUSY, 0, Event.ATTR_NONE, BlackBerryEvent.FB_FREE);                        } else {                                bbe.addInt(BlackBerryEvent.FREE_BUSY, Event.ATTR_NONE, BlackBerryEvent.FB_FREE);                        }                } else {                        System.out.println("*** FB_FREE not supported");                }

                try {                        bbe.commit();                } catch (PIMException pe) {                        System.out.println("*** Could not commit event");                }        }

Including this code is compiled under JDE 4.2.1

Run the application on a device running 4.7 (on a 9630), it will generate events throughout the day that are visible in all views of the calendar (works as expected for me).

Run the application on a device running 4.5 or earlier (as 4.2.1) it will generate all day events which are visible in the view of the order of the day, visible temporarily week view (but if you scroll far they 'disappear') and never visible in the day view.

Can someone comment on why this code does not work with the OS 4.5 and earlier versions?  All the assumptions have been broken in the code?  Do the specific dates and times assigned at the BEGINNING and END of question even though I'm this assigning an ALLDAY event?

Thanks for any help.

By experimentation, the apparent solution must normalize dates at midnight and check the date of the end one day later, as follows:

                Calendar startCal = Calendar.getInstance(ltz);                startCal.setTime(new Date(thisField.getDate()));                startCal.set(Calendar.HOUR_OF_DAY, 0);                startCal.set(Calendar.MINUTE, 0);                startCal.set(Calendar.SECOND, 0);                startCal.set(Calendar.MILLISECOND, 0);

                bbe.addDate(Event.START, 0, startCal.getTime().getTime());//              bbe.addDate(Event.START, 0, thisField.getDate() + ltz.getRawOffset());

                Calendar endCal = Calendar.getInstance(ltz);                endCal.setTime(new Date(thisField.getDate()));                endCal.set(Calendar.DAY_OF_MONTH,endCal.get(Calendar.DAY_OF_MONTH) + 1);                endCal.set(Calendar.HOUR_OF_DAY, 0);                endCal.set(Calendar.MINUTE, 0);                endCal.set(Calendar.SECOND, 0);                endCal.set(Calendar.MILLISECOND, 0);

                bbe.addDate(Event.END, 0, endCal.getTime().getTime());//              bbe.addDate(Event.END, 0, thisField.getDate() + ltz.getRawOffset());

Tags: BlackBerry Developers

Similar Questions

  • Windows Calendar all day event problems

    Windows Calendar has a default value of 12: 00 to 12: 00 on all the events of the day.   When I get the all-day event to say 05/02/2011 to 07/02/2011, it appears on the calendar itself as 05/02/2011 to 06/02/2011. So instead of being visible Saturday to Monday included, it shows that Saturday to Sunday - leaving white date Monday.   The only way that he will reveal on Monday, is if I change the date that is in fact the Tuesday 08/02/2011.  Is there a way to stop what is happening?

    Hello

    This is normal and you should send feedback if you wish, it changed in future versions of Windows:

    Check out the link:

    Windows 7 comments

    http://mymfe.Microsoft.com/Windows%207/feedback.aspx?formid=195

    Concerning

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I transform my ipad app within an app that works for the iPad and iPhone?

    I built an ipad with the DPS application. But now my client wants to have the same content on iphone. How can I transform my ipad app within an app that works for the iPad and iPhone?  Is this possible without creating a new application App Builder? Thanks for your replies.

    You must create a new instance of the DPS App Builder application. Select iPhone and iPad. If you use the same mobileprovision files (or mobile layout updated of the files of the bases on the same ID App), it is considered that a version update of the application itself.

    You will need create sheets separated for the iPhone. folios iPad do not appear in the library of iPhone. See Digital Publishing Suite help | Creating content DPS for iPhones.

  • I just bought photoshop elements 13, but now, when I wasn't downlowd, I m shore - it's for my iMac. What shal I do to fix that works for my iMac?

    I just bought photoshop elements 13, but now, when I wasn't downlowd, I m shore - it's for my iMac. What shal I do to fix that works for my iMac?

    If you need the Mac version, download the trial version for the Mac and use the serial number, have you already activate it.

    PSE 13 trial - http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements

  • I can't see the all-day event

    Help, please!

    After adding all the events of the day to my iCal I can no longer see it!

    A one day event should appear at the top of the list of

    hours that day just after 12: 00 a.m. - just

    following the day of the week "Wednesday".

    Good luck, Tom

  • Loading of the connected battery, do not... (found the solution that worked for my Dell Inspiron

    Well, the charger is plugged, but he says not charging. What happened twice. I would have thought bad battery or bad, but fortunately the first charger, that it took place just after buying a new hard drive. I did a hard reset on the battery and that worked.

    Now, it happened again. I tried resetting the regular battery, but that didn't work. I tried to uninstall the device and reinstall... did not work either.

    Curiously, what worked was this:

    I have had about 38% battery remaining. I unplugged the laptop computer power cord and the wall.

    I removed the dough. Computer has been cut.

    I wiped the connectors of the battery with a clean cloth, several times.

    I put the dough back in and turned the laptop on battery only.

    I plugged the power cord into the side of the laptop, and then into the wall outlet.

    Immediately, the laptop began to charge again!

    I don't know why it worked. Maybe some grumpy off he can know. When I tried to reset the battery, I turned off the computer before you take out the battery. Then he went out. Laptop with power cord is plugged in and powered it. Then stop down and placed battery. I turned her back... but nothing...

    It may have to do to have the laptop when you remove the battery, or place the power cord in back, or could be simply wipe cloth?

    Hi thelights007,

    Please share the system model and the installed operating system. The error "plugged not charging" can be caused for a variety of reasons as defective adapter or a faulty load Board.

    Try the below mentioned steps that can help fix the problem. Procedure for running flea power is:

    • Turning the system off.
    • Disconnect all external devices (printers, external hard drives, flash drives) of the computer.
    • Disconnect the power adapter and remove the battery.
    • Press and hold the power button for 20 to 30 seconds to release the residual charge of the laptop.
    • Reconnect the battery and the AC adapter.
    • Once the system is turned on and booted properly, replace the battery. Check whether you still receive the error.
    • Start the system BIOS by pressing the F2 key on the Dell logo screen when you turn on the system.
    • Press the F9 key to load the BIOS default settings. When finished, press the F10 key to save and exit. System will reboot. Check to see if the error is still there.
    • Try to wiggle the cable of the AC adapter / CC and check if it makes a difference.
    If it still does not work, spare parts may be necessary.

    I hope this helps. Please share the findings.

  • Gallery of images or the Lightbox that works for DW CS6?

    Help! I need a gallery of images or the lightbox that works! I tried the Lightbox Gallery in Widgets and all this works for the most part, do not show the nav buttons and I put the files in each directory (path) as possible. Does anyone have a solution for this - I read the forums for hours about it. OR is there something that is easy and quick and works? And if all goes well free?

    Thank you very much!

    The first thing I noticed is that you're missing your departuretag

    After repairing this error, run your page through the validator here: http://validator.w3.org/ and clear to top all others. HTML errors are one of the biggest culprits in bad/bad display problems.

    In addition, please download the page to a location to test on your website so that we can see the code in action in a real browser, it's the only real way to tell you what goes wrong in about half of cases of something like what is happening. Once the problem has been resolved, you can delete the directory on your server.

  • Is there a version of subway of Firefox that works for Windows 8.1 no touchscreen computers?

    I have an of 8.1 for Windows 64 - bit computer which does not support the Touch functions. Is there a subway of Firefox version that works on 8.1 for Windows 64-bit computers that do not support touch? If so, how can I get it?

    Hello Joshua_Lewis, you can also use the version metro with the mouse and keyboard (however I don't know what would be the advantage of this on the desktop version of firefox).

  • Is there a driver for HP Scanjet 5370C that works for Windows 7?

    I have upgeaded from Win XP to Windows 7 and HP scanner does not work. HP doesn't have a driver to Win 7 support.

    After double checking of this list, you are right in saying that there is no Win 7 drivers.   On a better note, it had a link to third-party software solutions scan on the HP website. Try these drivers, they might work for you.

  • Event Swipe works in the Simulator, but not on the device

    I'm using panels on my 9900 and I have 4 panels that the user will slide back and forth similar functioning BB app world, changing the summary of comments on signs etc..

    My expection who was up and down for scanning of touch screen functions and the touchpad has the same function by default, that is to the left and right slide on the screen should also be identical to forehand and left on the block to tack. But it does nothing for the panels when you use the trackpad.

    So I replace NavigationMovement and and can see the touchscreen and the track pad to generate a NavigationMovement event with +/-x according to the direction slide. So I'm first puzzled why hit swiping the trackpad on the left and right triggers not the same behavior by hitting swiping left and right on the touch screen.

    Accept that as a limitation of the API, I added my own features to NavigationMovement to inject a key event when user left or right on the trackpad moves. As follows:

    EventInjector.TouchEvent [] moveEvents = new EventInjector.TouchEvent [7];

    moveEvents [0] = new EventInjector.TouchEvent (TouchEvent.MOVE, 420, -1, -1, 60-1);
    moveEvents [1] = new EventInjector.TouchEvent (TouchEvent.MOVE, 360, 60,-1, -1, -1);
    moveEvents [2] = new EventInjector.TouchEvent (TouchEvent.MOVE, 300, 60,-1, -1, -1);
    moveEvents [3] = new EventInjector.TouchEvent (TouchEvent.MOVE, 240, 60,-1, -1, -1);
    moveEvents [4] = new EventInjector.TouchEvent (TouchEvent.MOVE, 180, 60,-1, -1, -1);
    moveEvents [5] = new EventInjector.TouchEvent (TouchEvent.MOVE, 120, 60,-1, -1, -1);
    moveEvents [6] = new EventInjector.TouchEvent (TouchEvent.MOVE, 60, 60,-1, -1, -1);
    EventInjector.TouchEvent.injectSwipeGesture (480, 60, moveEvents);

    It works perfectly in the Simulator, but on the device, there is no movement at all. So I thought that maybe the touchpad on the Simulator is more sensitive than on the real device, so I added a menu item to perform the injection above. Again, this works perfectly on the Simulator, but nothing on the device.

    Has anyone tried this brain left and just before the injection?  Up and down the injection works perfectly on the device.

    Have you enabled event injection in request permission settings for your application?  It is disabled by default.  You can do so by going to Options-> Application, select your application and click on change permissions.  You can also request these permissions programmatically using the class ApplicationPermission.

  • Your updates have messed up my Web pages and how they work. I am not happy! I can't restore what I had before, that worked for me. Firefox 4 crashes my Mac. And my web pages refresh more correctly. Please stop breaking things.

    Yesterday, I upgraded to firefox 4 because I had problems with noscript and my version previous freeze my mac book. I don't remember what the previous version was, unfortunately, because I would like to return.

    In the previous version, the links on web pages would open a new tab at the end of the tab chain. It worked very well for me because it allowed me to have a list of things I wanted to read after the tabs that I keep it open all the time.

    Firefox 4 and, it seems, all Firefoxes after only 3.6 open new tab next to the page you. This messes up my organization of the tabs. Sometimes, I find an article I want to read, but can't read it just right then. I want the end of all the tabs not in the middle of the tabs I keep open to the pages, I have followed all the time.

    Is it possible that I can have the open tab as the last tab on the channel rather than next to the tab I'm.

    Other problems, but I don't know if it's a firefox thing or a thing of the Web page.

    Type of topic: config in the URL bar and press ENTER.
    If you see the warning, you can confirm that you want to access this page.

    Filter = browser.tabs.insertRelatedAfterCurrent

    Double-click the preference to change the false value

  • Error Code C00D0FAB. Has anyone ever produces a solution that works for this error code?

    I tried all of the suggestions by the contributors of this forum (and a big thank you to them all in an attempt to address a problem that bothers the _ out of me), I rebooted Windows Vista 3 times, imported from different codec and packets, tried to re-download WMP and told me I had the latest version (WMP 11) run different programs of Malware in Mode safe run sfc/scannow five times and I'm still not close to correct the problem with my WMP. My computer is a Compaq Presario running the version of Vista Ultimate 32 bit.
    A response from anyone who has actually found a working solution would be greatly appreciated.

    Well after a long evening of playing with the same problem and looking for any help.  I upgraded my Nvidia Nforce Serial ATA controller and my media player works now.  I also improved other drivers beforehand if it can't just be this one.  It's under the IDE in the hardware section of the control panel.  Good luck to all others so unhappy as to met this seemingly intractable problem.

  • Replacement of mixture BB blackBerry Smartphones that works for Priv?

    There may be a wire buried here, which has the answer but.

    I love my private but was one of the best features of my old "BOLD" mixture. I could handle all my SMS etc from my Win7 desktop. It has been integrated, solid and it worked.

    Is there such a thing as mixture for Android (device) and desktop (Win 7 or 10)?

    I tried an app, that I found on the app store, but it has not been integrated and I found myself hoping for BB to deliver something. Its for a year I finally asked but did ut there now?

    Thank you

    Hi @wilwoods

    No changes sorry - mix only BlackBerry 10 terminals supported and is no longer supported.

    An Android compatible version should get out I'll be sure to share the info here

  • Lexmark X502n all-in - One Printer work for printing, but not scan

    Hello

    Installing Win7 (64 - bit, Enterprise) driver for these printers worked very well only for printing.

    A driver for the scanner will not be detected and I find an entry in the Device Manager als Scan with the ID of 'USB\VID_043D & PID_0109 & REV_0001 & MI_01' material

    The 'top' company Lexmark :-( Support replied on my survey abou this, that there is no support for this printer, weather by lexmark, or Microsoft. But on their own support page (http://support.lexmark.com/index?page=content&id=os6&locale=EN&userlocale=EN_UK), they offer to use the Windows 7 operating system driver.

    Have someone at - it an idea how to get scanner work?

    Thank you for the Germany

    Georg

    The driver offered to Microsoft by Lexmark is very basic and will allow only for printing so that you can always get the main use of your Lexmark all in one.

    Support ended with XP and there had been no complete driver released for Vista or Windows 7 package and will never be. Lexmark being solely responsible for drivers, if you want to scan functions, you can buy a product that has full Windows 7 support...

  • Is there an add-on that WORKS for groups of lost tabs?

    STILL lost most all my groups of tabs! Third or fourth time, Im fed up!
    I read some reviews on group managers, and basically, they were not very good.
    If I want to save something else on my computer, or copy / rename it, ITS EASY!

    is there a small program that would just save until this thing jstore each day? I could just hit every day. I'm good at backups, bad at having to remember proceedures as is required to save this file every day. I never even remember where it is.

    I look forward to your advice on the modules, or easy ways to save the jstore thing.

    You can use this button to go to the Firefox profile folder currently in use:

    • C:\Users\ < user > < profile > \AppData\Roaming\Mozilla\Firefox\Profiles\.

    Windows hides certain default file extensions.
    Among them are .html, .ini and .js, .txt, so you can see only file name without the file extension.
    You can see the type of actual file (file extension) in the properties of the file via the context menu in Windows Explorer.

Maybe you are looking for