Re: GPS updates (Looper)

225 views
Skip to first unread message

Kristopher Micinski

unread,
Jun 4, 2012, 12:17:26 PM6/4/12
to android-...@googlegroups.com
Sure,

http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,
float, android.location.Criteria, android.location.LocationListener,
android.os.Looper)

has a parameter that takes a looper..

You can call Looper.prepare in your thread..

kris

On Mon, Jun 4, 2012 at 8:58 AM, Peleg Bahar <peleg...@gmail.com> wrote:
> I'm trying to send a requestLocationUpdates from a thread that is not the UI
> thread.
> I get a runTimeError that says that I don't have a Looper.
> Can I get GPS updates in another thread without using a Looper?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-platform" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-platform/-/BME_YmFbi6EJ.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-platfo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-platform?hl=en.

Kerr

unread,
Jun 4, 2012, 10:20:21 PM6/4/12
to android-...@googlegroups.com
I is very esay.
Because service send message to your thread through Hander, But your thread has not looper.
You can call like this.
Looper.prepare();
...sendRequestLocationUpdates();
Looper.loop();
 
 

On Monday, June 4, 2012 8:58:43 PM UTC+8, Peleg Bahar wrote:
I'm trying to send a requestLocationUpdates from a thread that is not the UI thread.
I get a runTimeError that says that I don't have a Looper.
Can I get GPS updates in another thread without using a Looper? 

Thanks.

On Monday, June 4, 2012 8:58:43 PM UTC+8, Peleg Bahar wrote:
I'm trying to send a requestLocationUpdates from a thread that is not the UI thread.
I get a runTimeError that says that I don't have a Looper.
Can I get GPS updates in another thread without using a Looper? 

Thanks.

On Monday, June 4, 2012 8:58:43 PM UTC+8, Peleg Bahar wrote:
I'm trying to send a requestLocationUpdates from a thread that is not the UI thread.
I get a runTimeError that says that I don't have a Looper.
Can I get GPS updates in another thread without using a Looper? 

Thanks.

Reply all
Reply to author
Forward
0 new messages