2012-03-13 107 views
0

如何創建非阻塞彈出如何創建非阻塞彈出

      LayoutInflater inflater = (LayoutInflater) 
         PollRatings.this 
         .getContext().getSystemService(
         Context.LAYOUT_INFLATER_SERVICE); 
         View layout = inflater 
         .inflate(R.layout.toast, null); 
         PopupWindow pw = new PopupWindow(layout, 300, 
         470, 
         true); 
         pw.setFocusable(true); 
         pw.setOutsideTouchable(true); 
         pw.setTouchable(true); 
         pw.showAtLocation(layout, Gravity.CENTER, 0, 0); 

但是當我顯示彈出,屏幕上的其他部件都blicked(我不能點擊任何東西),如何解決這個問題?

回答

0

然後嘗試通過啓動計時器,並在計時器的run()的方法做dialog.cancel()取消從代碼的對話框。