@Override public void onResume() { super.onResume(); Cursor cursor = getActivity().getContentResolver().query(ThemeColumns.CONTENT_URI, null, null, null, null); if (cursor != null && cursor.getCount() == 0) { setEmptyText(getString(R.string.no_local_theme)); } if (cursor != null) { cursor.close(); } if (mLocalCusorAdapter != null) { mLocalCusorAdapter.notifyDataSetChanged(); } }
@Override public void onDestroy() { super.onDestroy(); mLocalCusorAdapter.changeCursor(null); }