Reputation: 658
I have favorite page with gridview for wallpaper app. sometimes this page for user is empty
I wanna show the textview "There is no item" when the gridview is empty
what should i do?
thanks
Upvotes: 0
Views: 854
Reputation: 2493
Use a TextView as empty view.
TextView emptyView = (TextView)findViewById(android.R.id.empty);
emptyView.setText("There is no item");
gridView.setEmptyView(emptyView);
This will show the empty message when GridView is empty.
Upvotes: 3