// Refresh data here. @Override public void onResume() { super.onResume(); data = DB.getAllProduct(); mAdapter = new FavoriteAdapter(getActivity(), data); mListView.setAdapter(mAdapter); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } data = DB.getAllProduct(); mAdapter = new FavoriteAdapter(getActivity(), data); createSwipeCreator(); }