2013-09-27 49 views
0

我正在使用GoogleMap.InfoWindowAdapter來設置標記窗口的內容。實現標記窗口

但內容是在服務器上,我正在使用asynctask來獲取它。

這筆交易是當我有迴應我的窗口已經創建。 如果我等待這樣的asynctask響應:asynctask.execute(...)。get()應用程序在執行期間凍結。

我想要做的是用progressBar顯示一個窗口,當我得到服務器的響應時,我刪除progressBar並實現窗口的內容。

我該怎麼做?

在此先感謝

回答

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.

你是什麼試圖做的不是goi由於它以圖像的形式呈現,因此無法工作。你可以模擬這個問題的唯一辦法是不斷地打電話showInfoWindow()在進度更新的

看看這個鏈接

Google Maps Version 2 - Updating information windows

+0

這不是問題的關鍵。該請求位於InfoWindowsAdapter中。 不在簡單的片段或活動中。 – nsvir

+0

它不會如何工作,請參閱我的編輯 – tyczj