Thanks for the link, but it doesn't really explain why the network provider isn't kicking in after trying the GPS and Passive providers.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of BelvCompSvs Sent: Thursday, November 17, 2011 11:50 PM To: Android Developers Subject: [android-developers] Re: Please Help with GPS Provider Switch http://www.youtube.com/watch?v=twmuBbC_oB8&feature=player_embedded On Nov 16, 11:24 am, "Tommy Hartz" <[email protected]> wrote: > Hey, > > Right now when trying to get a user location I start with the GPS Provider. > I have a timer set for 30 seconds, If a location is not found in 30 > seconds the timer goes off and stops that location request. When that > happens I move to the Passive Provider. After 30 seconds if a location > is not found I stop the location request and move to the Network Provider. > > My issue is that when the network provider gets called it never does > anything. If I start with the network provider it goes off just fine > and returns a location back to me. Below is the code I am trying to use: > > gpsTimer.schedule(new TimerTask(){ > > @Override > > public void run() { > > startPassive(); > > } > > }, 30000); > > currentTimer = "GPS"; > > locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, > 0, 0, locationListener); > > private void startPassive(){ > > locationManager.removeUpdates(locationListener); > > //Now we want to try for a Passive Fix > > currentTimer = "Passive"; > > passiveTimer.schedule(new TimerTask(){ > > @Override > > public void run() { > > startNetwork(); > > } > > }, 30000); > > Looper.prepare(); > > Looper.myLooper().quit(); > > locationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDE > R, 0, 0, locationListener); > > private void startNetwork(){ > > locationManager.removeUpdates(locationListener); > > currentTimer = "Network"; > > Looper.prepare(); > > Looper.myLooper().quit(); > > locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDE > R, 0, 0, locationListener); > > any help or suggestions would be greatly appreciated. Thank so much in > advance. -- 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 -- 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

