Android: set empty view to a list view

前端 未结 5 504
情深已故
情深已故 2020-12-28 17:36
 

        
5条回答
  •  情歌与酒
    2020-12-28 17:56

    if you are using ListActivity then no need to set the empty view manually. Remove list.setEmptyView(findViewById(android.R.id.empty)); from your code.

    Change your layout like below then it's automatically add EmptyView if list has no item:

    
    
    
        
    
         
    
    
    

提交回复
热议问题