BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-22-2010, 02:02 AM   #1
imran2k1
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: telus
Posts: 35
Default Accessing Start and End time field of the calent event

Please Login to Remove!

hi all
i am getting problem to access the start and end time field of the calendar event. i am using below code in that i am getting some field like subject and notes, but i am not getting start, end time field and "start time as" field.
if any one know please help me.
Code:
EventList eventlist=null;
Enumeration e;

try{
		
		eventlist =(EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
	}
	catch(PIMException e){
		
	}
try {
		e= eventlist.items();
		
		
	//	e= eventlist.items(EventList.STARTING, startDate, endDate, true);
		
		
		
	} catch (PIMException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	while (e.hasMoreElements()) {
		Event event1 = (Event)e.nextElement();
		int[] fieldIds = event1.getFields();
		int xxx=fieldIds.length;
		int id;
		for(int index = 0; index < fieldIds.length; ++index) {
		id = fieldIds[index];
		if(event1.getPIMList().getFieldDataType(id) == PIMItem.STRING) {
			
			System.out.println(eventlist.getFieldLabel(id).toString());  // 0-4, free to busy giving the field information
	
			for(int j=0; j < event1.countValues(id); ++j) {
		
				String value = event1.getString(id, j);
		         System.out.println(event1.getFields() + "=" + value);
	
	
		}
	
		}
		}
		}
	
	try{
		
		eventlist.close();
	}catch(Exception e){
		Dialog.alert("Error in close:"+e);
	}
	
	
	}
is am i doing any wrong?
or any other way to retrieve the "start time", "end time" and "start time as" field data?

Thanks and regards
Imran ali
Offline  
Old 01-23-2010, 11:55 AM   #2
Smiley8
Talking BlackBerry Encyclopedia
 
Smiley8's Avatar
 
Join Date: May 2008
Location: Calgary, AB
Model: Torch
Carrier: Fido
Posts: 226
Default

use this method

start = event1.getDate(Event.START, 0)

end = event1.getDate(Event.END, 0)
__________________
Visit our website www.toysoft.ca for Cool BlackBerry Apps.

Follow us @ http://twitter.com/toysoft
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Altair WBS-202 Dual channel wireless intercom base station picture

Altair WBS-202 Dual channel wireless intercom base station

$1350.00



New MSA Altair Pro O2 Gas Detector (Part Number 10074137c) - Open Box picture

New MSA Altair Pro O2 Gas Detector (Part Number 10074137c) - Open Box

$269.99



MSA altair 4X multi gas meter Monitor detector, O2,H2S,CO,LEL Charger calibrated picture

MSA altair 4X multi gas meter Monitor detector, O2,H2S,CO,LEL Charger calibrated

$450.00



Altair2X Co Instrument CO Gas Detector picture

Altair2X Co Instrument CO Gas Detector

$499.99



MSA Altair 5X Replacement MSA Sensor MSA  NH3 Ammonia Surplus #10106726 picture

MSA Altair 5X Replacement MSA Sensor MSA NH3 Ammonia Surplus #10106726

$299.99



MSA altair 4X gas Monitor detector, O2,H2S,CO,LEL Charger calibrated picture

MSA altair 4X gas Monitor detector, O2,H2S,CO,LEL Charger calibrated

$450.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.