如何从Service类(Android)中检测“Recent Activities Tab”按钮?

时间:2012-07-18 10:12:40

标签: android dialog android-input-method

这是我的代码:

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();
    }

它显示一个警告对话框,一切正常,显示对话框后,当我按下最近的活动Tab(4.0),如果我选择其他一些活动,那么对话框仍然没有被解雇,这个方法我打电话给输入法服务...在按下最近活动按钮时将调用回叫的服务?需要快速帮助...在此先感谢安卓人员..

0 个答案:

没有答案