Code example for ListFragment

Methods: onViewCreatedsetListAdapter

0
        adapter = new PostAdapter(getActivity(), R.layout.post_item, posts, this);
    } 
 
    @Override 
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        setListAdapter(adapter);
    } 
 
    public void setData(ArrayList<Post> data) {
        posts.clear();
        posts.addAll(data);
        if (adapter != null) {
            adapter.notifyDataSetChanged();
        } 
    } 
 
    private void showQuotes(Post post) {
        if (!post.hasQuotes()) {
            return;