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
Trusted Contributor
hims_3009
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000

Re: Two location Listener for Different Time Interval

While Debugging Application in Eclipse I found that though I used two Different LocationProvider with 2 different Criteria and two different Listener for Provider , The Previous providers listener will be made null. as shown in attached image..

  

Lathiya Himanshu
Please use plain text.
Developer
Pascal_Bourque
Posts: 149
Registered: ‎03-09-2009
My Device: Not Specified

Re: Two location Listener for Different Time Interval

[ Edited ]

As telematicus said,

A solution to your problem is to have a singleton who send the position get from the provider.

After, you can use a Timer with two timerTask (1 scedule at 5 sec. and another at 42 sec) and calling your singleton to have the position, you can securise your procedure by validate the date in the position against the real time clock.

A solution in theory only, but i use a similar procedure to swith on and off the BlackberryLocationProvider from different condition and it work perfectly

Pascal Bourque, Analyste-Programmeur : "je pense donc je programme"
Really want to thank a user? Click the Kudos! badge on right side of the message. When you do so, you are offering a thumbs up for good content and a pat on the back to its author.
Accepted Solutions is a way for you to choose the reply that best answers a thread that you've started. To mark a message as a solution: Click the Solution? icon on the reply.
Please use plain text.
New Developer
kalpeshtita
Posts: 12
Registered: ‎11-09-2009
My Device: Not Specified

Re: Two location Listener for Different Time Interval

Hi,

 

I'm also agree with Pascal_Bourque try that it will work properly an it's very easy.

 

Regards

kalpesh

Please use plain text.