popup window로 만들고 있는데,

 

onkeyListener 등록이 전혀 안되네요 ㅠㅠ

 

다음은 코드입니다.

 

  private PopupWindow pw;
    private void GeneratePopupWindow() {       
     try {           
      LayoutInflater inflater = (LayoutInflater) Project_SNUGO.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);       
      View layout = inflater.inflate(R.layout.popup_selection, null);    
      pw = new PopupWindow(layout, 360, 280, true);           
      Drawable Background = pw.getBackground();
      pw.setOutsideTouchable(true);
      pw.setBackgroundDrawable(Background);
      pw.showAtLocation(layout, Gravity.CENTER, 0, 0);
      
      Button btn_yes = (Button)layout.findViewById(R.id.Decision_Yes);
      Button btn_no = (Button)layout.findViewById(R.id.Decision_No);
      btn_yes.setOnClickListener(Decision_ClickListener);
      btn_no.setOnClickListener(Decision_ClickListener);
      //getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
      findViewById(R.id.find_by_location).setOnKeyListener(Decision_KeyListener);
     } 
     catch (Exception e) {      
       e.printStackTrace();     
     }
        
     
     }
    /***********************************************************************************/
    private View.OnKeyListener Decision_KeyListener = new View.OnKeyListener() {
        public boolean onKey(View v, int KeyCode, KeyEvent event) {
            if(event.getAction()==KeyEvent.ACTION_DOWN){
             switch(KeyCode){
             case KeyEvent.KEYCODE_BACK:
              pw.dismiss();
              return true;
             } 
            }
            return false;
        }
    };
    /***********************************************************************************/
    

인터넷을 마구 뒤져보니, 팝업 윈도우에서는 KeyListener가 먹질 않는다고 해서 BackGround Touchable하게 만들고 Background에 대해서 KeyListener를 달으라고 했는데, 위에서 터쳐블 하게 만들어놔도 되지가 않네요......popupWindow가 뷰가 아니니까 리스터 등록도 안되구요....

View layout 에서 layout도 나름 View인데 이건 또 왜 등록이 안될까요....??

 

그리고 현재는 배경이 전혀 blur가 안되어 있는데, 배경 블러를 하는 방법을 좀 알려주시면 감사하겠습니다

 

반나절가량 이거만 헤집고 있는데 너무안되네요 ㅠㅠ