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

Reply
BlackBerry Development Advisor
Posts: 15,017
Registered: ‎07-09-2008
My Device: BlackBerry Passport

cant get PIMList size from batchOperation(PIMList pimlist)

Quote from the previous forums:


satyam

Posts: 19
From: Pune
Registered: Apr, 2008

cant get PIMList size from batchOperation(PIMList pimlist)
Posted: Jul 17, 2008 8:09 AM
 
Hi
i am using PIMListListener2 and implemented its method batchOperation(PIMList pim).

when I synch my device(8800)with desktop manager and add some contacts batchOperation method gets invoked.

when I try to get PIMList size in the same method using enumeration like
----------
Enumeration e = pim.items();
int count =0;
while(e.hasMoreElements())
{

count++;

}
-----------
synch process does not complete and last screen on my desktop saying "one moment please" keeps showing.

it it happening due to accessing PIMList?
how can i get size ?
If I print only name of the PIMList pim it works ok .
does anybody tried anything like this before ...

 


What BlackBerry model and handheld software version are you testing on?  You can find this under Options, About on the BlackBerry.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 7
Registered: ‎07-18-2008
My Device: Not Specified

Re: cant get PIMList size from batchOperation(PIMList pimlist)

I am testing on BlackBerry 8800

v 4.2.1.68(platform 2.3.0.54)

BlackBerry Development Advisor
Posts: 15,017
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: cant get PIMList size from batchOperation(PIMList pimlist)

You have an endless loop there.  You need to call nextElement() on the enumeration within your loop in order to move to the next item.  Otherwise the cursor is always at the first postion, so hasMoreElements keeps returning true.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker