Clicking spinner within popup window causes WindowManager$BadTokenException

前端 未结 4 1581
你的背包
你的背包 2020-12-11 21:34

I\'ve looked up a couple of posts for the same problem but can\'t seem to resolve my issue. I\'ve used spinners throughout my application and they are working fine. It\'s wh

4条回答
  •  没有蜡笔的小新
    2020-12-11 21:45

    The following is how the popup code is being called. I've declared the variable for the PopupWindow and ViewGroup so it can be used throughout the class

    private PopupWindow pw_references;
    private vg_references;
    

    The code that calls the PopupWindow is called within an event handler for a button.

    public void ibtn_references_Click(View view) {
        ...
        // 1st section of code in the original post
    }
    

    This button is inside a linearlayout (seperate layout file) that is then included within a framelayout on the current screen. Included something like the following.

     
    
        
    
    
    

提交回复
热议问题