setTestProviderLocation() does not trigger calling of onLocationChanged()

前端 未结 6 2104
野的像风
野的像风 2020-12-10 07:42

I\'m trying to get this bit of code to work:

Testing GPS in Android

The problem is, when I run the test, onLocationChanged() is never called:



        
6条回答
  •  半阙折子戏
    2020-12-10 08:42

    I ran into a similar problem. Regardless of what I tried, I could never get onLocationChanged() to be automatically called. Eventually, I gave up and created a method that both set the location with setTestProviderLocation() and directly called onLocationChanged(). It's not a perfect solution, but it worked for my needs.

提交回复
热议问题