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 に答える