Kar*_*lis 6 android android-location
我正在使用此示例开发基于位置的应用程序:http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/
但是当我打开手机时,该位置就不可用了.所以我想在等待位置时显示进度对话框.想在后台使用AsyncTask执行此操作.
您能否提出任何想法以及如何做到这一点?
不需要AsyncTask,因为Location服务已经在不同的进程中运行,只需实现LocationListener并在resume方法中注册它,然后在onCreateActivity中检查location是否为null,显示ProgressDialog,并onLocationChanged()设置位置并关闭ProgressDialog
| 归档时间: |
|
| 查看次数: |
6382 次 |
| 最近记录: |