Problems with ListView inside a PopupWindow

后端 未结 4 2101
温柔的废话
温柔的废话 2021-01-06 20:10

I have a ListView in a PopupWindow. The PopupWindow is initialized like this

    window.setContentView(root);
    wind         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 20:32

    use this

    fileList.setOnItemSelectedListener(new OnItemSelectedListener() {
    
            public void onItemSelected(AdapterView arg0, View arg1,
                    int pos, long arg3) {
                selected = (File) fileList.getItemAtPosition(pos);    
    
            }
    
            public void onNothingSelected(AdapterView arg0) {
                // TODO Auto-generated method stub
    
            }
    
        } );
    

提交回复
热议问题