LocationListener.onLocationChanged が呼び出されるまで待機メッセージを表示するために、何を実装する必要があるかを誰かが提案できますか?
タイトルのないダイアログを使用してみましたが、問題は次のとおり
です。 1.それを作成するとsetCancelable(false)
、ユーザーは戻るボタンを押すことさえできなくなります。
2. を作成するsetCancelable(true)
と、onLocationChanged() の前に出ます。
以下は私のコードです
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Please Wait for GPS Signals...").setCancelable(false);
mLocationWaitDialog = builder.create();
mLocationWaitDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
WindowManager.LayoutParams layoutParam = mLocationWaitDialog.getWindow().getAttributes();
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
layoutParam.y = -height / 2; // y position
mLocationWaitDialog.show();