Why you are not using IntentService? that class stop the service when it
finished.
On Friday, November 9, 2012 3:21:25 PM UTC-5, Rajan wrote:
>
> What i need to do
> =============
> 1. I need to get Latitude & longitude every 1 min.
> 2. after getting this lat & long, i need to call one web service through
> which i have to send <latitude, longitude, TAG>
>
> TAG is kind of "ON" or "OFF" text : that can be set on button press event.
>
> What i have done
> =============
> 1. i created one simple service that can be use to get lat & long
> and also use AsynTask inside the service for calling a webservice
>
> 2. i have use Time class for ping after every 1 min.
>
> 3. now i need to add TAG value inside the background service using on
> button pressed event : that i have already done
>
> [ like :
>
> Intent i = new Intent(this, BackgroundService.class);
> i.putExtra("TAG","ON");
> startService(i);
> ]
>
> My Problem
> =========
>
> it block my UI thread after every 1 min. , means when my time is going to
> ping a backgroundService for finding a lat & long at that time it will
> block my UI for few seconds.
> so how can i prevent my UI thread ??
>
> Note : for start & stop to the background service, i have use Handler
> class & Message class
>
> please help me i'm stuck in this scenario since last 2 to 3 days, i didn't
> find any single way to prevent my UI thread.
>
> thank you.
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en