BlackBerryForums.com : Your Number One BlackBerry Community   Wallpaper Megaplex for BlackBerry   

»Sponsored Links



Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
mbk Offline
New Member
 
Posts: 1
Join Date: Oct 2005
Model: 7230
Exclamation MIDP 1.0 DateField.getDate() returns null for times in the AM but not PM? - 11-15-2005, 06:56 PM

MIDP 1.0 DateField.getDate() returns null for time values in the AM but works for PM values

I have a pure midp 1.0 midlet that works well on Nokia, Sony Ericsson and Motorola devices but fails on a BB 7230.

The midlet raises a null exception when it tries to get the value in a datefield item (that is set to act as a time field) that is displaying an AM value (00:00-12:59).
- The error occurs in both 12hr and 24hr device clock settings.
- Forcing the AM/PM and Hour properties has no effect.
- It does not matter whether the time field has been edited or left with the default value.

Code snippets...

*Building the Time Field Item
...
c.set(Calendar.HOUR_OF_DAY,hour); //set time always using 24 hour time eg HOUR_OF_DAY when saving or sending
c.set(Calendar.MINUTE,minute);
c.set(Calendar.SECOND,second);
tmpItem=new DateField(label,DateField.TIME,TimeZone.getDefaul t());
((DateField)tmpItem).setDate(c.getTime());
...

*Getting the Time Field Value from a Form Item
...
}else if(p1 instanceof DateField){
//get the entered date or time
Calendar c=Calendar.getInstance();
c.setTime(((DateField)p1).getDate()); //FAILS HERE if time is AM == null returned from getDate()
...


The bb is one of the best devices out there to run my midlet - but not with the current problem.

Please help if you have seen this or any similar problems with midp on these devices.
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Wallpaper Megaplex for BlackBerry


Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1