package com.leavjenn.hews.ui;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.leavjenn.hews.model.Post;

import java.util.List;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;

public class BookmarkFragment extends BasePostListFragment {

    public BookmarkFragment() {
    }

    public static BookmarkFragment newInstance() {
        BookmarkFragment fragment = new BookmarkFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = super.onCreateView(inflater, container, savedInstanceState);
        getPostBookmarks();
        return v;
    }

    private void getPostBookmarks() {
        mCompositeSubscription.add(mDataManager.getAllPostsFromDb(getActivity())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<List<Post>>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(List<Post> posts) {
                        mSwipeRefreshLayout.setRefreshing(false);
                        for (Post post : posts) {
                            mPostAdapter.add(post);
                        }
                    }
                }));
    }

}

@@ -874,32 +874,98 @@
         
-getPostBookmarks
+return v;%0A    %7D%0A%0A    @Override%0A    public void onResume() %7B%0A        super.onResume
 ();%0A    
@@ -964,32 +964,42 @@
 ();%0A        
-return v
+getPostBookmarks()
 ;%0A    %7D%0A%0A   
@@ -1029,24 +1029,99 @@
 okmarks() %7B%0A
+        mPostAdapter.clear();%0A        mPostAdapter.notifyDataSetChanged();%0A
         mCom

fix (refresh bookmark list): refresh bookmark list when back to bookmark fragment.