0

我正在使用 GoogleMap.InfoWindowAdapter 来设置我的标记窗口的内容。

但是内容在服务器上,我正在使用 asynctask 来获取它。

交易是,当我得到响应时,我的窗口已经创建。如果我像这样等待 asynctask 响应: asynctask.execute(...).get() 应用程序在执行期间冻结。

我想做的是显示一个带有progressBar的窗口,当我得到服务器的响应时,我删除progressBar并实现窗口的内容。

我怎么能那样做?

提前致谢

4

1 回答 1

1

所以用于onPreExecute启动进度条并取消它onPostExecute

编辑

来自文档:

The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (for example, after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

您尝试做的事情是行不通的,因为它被渲染为图像。您可以模拟的唯一方法是不断调用showInfoWindow()进度更新

看看这个链接

Google 地图第 2 版 - 更新信息窗口

于 2013-09-27T15:03:36.607 回答