次の方法でLocationManagerからの通知の取得を開始する可能性があります。
requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper)
ドキュメントでは、次の単語で属性について説明しています。
provider the name of the provider with which to register
minTime minimum time interval between location updates, in milliseconds
minDistance minimum distance between location updates, in meters
listener a LocationListener whose onLocationChanged(Location) method will be called for each location update
looper a Looper object whose message queue will be used to implement the callback mechanism, or null to make callbacks on the calling thread
このメソッドで更新の受信を開始したい場合、(ルーパーの)クラスの動作をよく理解できません。
さらに、LocationManagerクラスの周りにライブラリを作成しており、通常の動作を実行する前に、他の作業を行う必要があります。私が必要としているのは、ライブラリのLocationListenerで更新の受信を開始し、いくつかの条件が確認された場合にのみ通常の動作を実行することです。
これを行うには、ユーザーが上記の方法で更新を受信し始めた場合にLocationManagerが実行する動作をシミュレートする方法を知る必要があります。
はっきりしているといいのですが。誰かが私を助けることができますか?ありがとう!