@Override
 public void onLoadFinished(final Loader<Cursor> loader, final Cursor cursor) {
   if (getActivity() == null) return;
   mFirstVisibleItem = -1;
   final MessageEntriesAdapter adapter = getAdapter();
   adapter.setCursor(cursor);
   adapter.setLoadMoreIndicatorVisible(false);
   adapter.setLoadMoreSupported(cursor != null && cursor.getCount() > 0);
   adapter.setLoadMoreSupported(hasMoreData(cursor));
   final long[] accountIds = getAccountIds();
   adapter.setShowAccountsColor(accountIds.length > 1);
   setRefreshEnabled(true);
   if (accountIds.length > 0) {
     showContent();
   } else {
     showError(R.drawable.ic_info_accounts, getString(R.string.no_account_selected));
   }
 }
 @Override
 public void onLoaderReset(final Loader<Cursor> loader) {
   final MessageEntriesAdapter adapter = getAdapter();
   adapter.setCursor(null);
 }