Android find GPS location once, show loading dialog

前端 未结 3 1841
感动是毒
感动是毒 2020-12-02 11:17

I am writing an app that requires the user\'s current location (lastknownlocation won\'t be very helpful) and displays a list of all the closest \"items\" to them taken from

3条回答
  •  被撕碎了的回忆
    2020-12-02 11:56

    Instead of creating an AsyncTask why didn't you create a ProgressDialog box and dismiss it on public void gotLocation(final Location location){}? You can also add a onCancelListener to the ProgressDialog box and cancel any current location requests.

提交回复
热议问题