Notify users when they reach a location

蹲街弑〆低调 提交于 2019-12-05 19:46:56

If the user closes your activity, you should indeed unregister your location listener.

It sounds like you need to move part of your application (the bit that monitors location and alerts the user) to a background service, so that it can continue to run even after the user closes the app.

all i need to do is define receiver in Manifest

then i don't need to register/unregister in Activity anymore

  <receiver android:name="th.clbs.android.broadcastreceiver.LocationReminderReceiver" >
        <intent-filter>
            <action android:name="th.co.clbs.action.LOCATION_REMINDER" />
        </intent-filter>
    </receiver>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!