Search Results

Search found 1 results on 1 pages for 'yorick'.

Page 1/1 | 1 

  • ListView created programmatically - emptyView doesn't show

    - by Yorick
    I've created custom ListView programmatically, and set view to show when ListAdapter is empty but nothing shows on the screen in that case, what can be wrong? public PlayerList(Context context, Activity activity) { super(context); mParent = activity; setOnItemClickListener( new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ... } }; List<PlayerInfo> players; players = getPlayerList(); // here size of players == 0 setAdapter(new PlayersAdapter(this.getContext(), R.id.player_name, players)); LayoutInflater vi = (LayoutInflater)mParent.getSystemService(Context.LAYOUT_INFLATER_SERVICE); emptyView = vi.inflate(R.layout.empty_view, null); // emptyView is View, and member of PlayerList this.setEmptyView(emptyView); }

    Read the article

1