1

这是我的代码:

public void displayQuickSettingsDialog() {
        if(quickSettingsDialog == null) {

            quickSettingsDialog = new Dialog(mContext);
            quickSettingsDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            Window win = quickSettingsDialog.getWindow();
            WindowManager.LayoutParams lp = quickSettingsDialog.getWindow().getAttributes();
            lp.token = mKptAdaptxtIME.mInputView.getWindowToken();
            lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
            lp.dimAmount = 0.5f;
            lp.y = lp.y + 150;
            win.setAttributes(lp);
            win.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
            win.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
            win.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);



            quickSettingsDialog.setContentView(R.layout.quicksettings);
            quickSettingsDialog.setCanceledOnTouchOutside(true);

            //listeners for dialog options
            quickSettingsDialog.findViewById(R.id.quick_sett_lang).setOnClickListener(this);
            quickSettingsDialog.findViewById(R.id.quick_sett_keyboard_type).setOnClickListener(this);
            quickSettingsDialog.findViewById(R.id.quick_sett_sugg_control).setOnClickListener(this);
            quickSettingsDialog.findViewById(R.id.quick_sett_settings).setOnClickListener(this);

        }

        quickSettingsDialog.show();
    }

它显示一个警报对话框,一切正常,在显示对话框后,当我按下最近的活动选项卡(4.0)时,如果我选择了其他一些活动,那么对话框仍然没有被关闭,这个方法我从输入法调用服务...在我按下最近的活动按钮时将调用回叫的服务中?需要快速帮助...提前感谢androidians ..

4

0 回答 0