Display “No Item” message in ListView

后端 未结 6 1574
清酒与你
清酒与你 2020-12-07 20:31

I\'ve created some composie UIs in my android apps and there are some ListView controls -among other controls- inside a view. Because of this, I have used \"Activity\" as my

6条回答
  •  萌比男神i
    2020-12-07 21:08

    You can use Toast Message for this..

    Check the Count of the Adapter value by adapter.getCount()

    if(Adapter.getCount()!=0){
          List.setAdapter(Adapter); 
    }else{
         Toast.makeText(YourActivityName.this, "No Items Available",Toast.LENGTH_SHORT).show();
    }
    

提交回复
热议问题