mercredi 6 mai 2015

Back and Home buttons are disabled on a layout

I am trying to implement an AlertWindow kind of thing where I am using the instance of WindowsManager to add a View on it from a Service. The View is visible and accessible. But the default system's back/home buttons are disabled. How to access them? I am new to Android.

Here is a snippet of my code:

        mLayout = new LinearLayout(this);
        mLayout.setLayoutParams(new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT));

        View view = LayoutInflater.from(this).inflate(R.layout.Mainactivity,
                mLayout, true);
        mTvErrorMsg = (TextView)view.findViewById(R.id.tv_error_msg);
        mChkBoxAppState = (CheckBox)view.findViewById(R.id.chkbox_app_state);
        mCancelBtn = (Button)view.findViewById(R.id.btn_action);

        mEdtPin.addTextChangedListener(this);

        try {
            mWindowManager.addView(mLayout, wmlp);
        } catch (RuntimeException e) {
            SymLog.e(TAG, "Failed to add lock page.", e);

        }

Aucun commentaire:

Enregistrer un commentaire