title: RecyclerView notifyDataSetChanged not working after Parse query
body: <p>I'm in a fragment trying to updated my recycler view, after querying Parse for some data.  In the <code>done</code> method of the query I call <code>notifyDataSetChagned</code>, but the list is never displayed</p>
  
  <pre><code>package com.garciaericn.t2d.fragments;
  
  public class DevicesCardViewFragment extends Fragment implements View.OnClickListener {
  
      private OnFragmentInteractionListener mListener;
      private BatteryHelper mBatteryHelper;
      Intent mBatteryStatus;
  
      private RecyclerView mRecyclerView;
      private DeviceAdapter mAdapter;
      private RecyclerView.LayoutManager mLayoutManager;
      private List&lt;Device&gt; mDevices;
  
      public DevicesCardViewFragment() {
          // Required empty public constructor
          mDevices = new ArrayList&lt;Device&gt;();
      }
  
      public static DevicesCardViewFragment newInstance() {
          // Bundle parameters is necessary
  
          return new DevicesCardViewFragment();
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          // Get arguments
          getDevices();
  
          mBatteryHelper = new BatteryHelper(getActivity());
  
          IntentFilter intentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
          mBatteryStatus = getActivity().registerReceiver(null, intentFilter);
  
          // Update stats of current device.
  
          Toast.makeText(getActivity(), "Battery level: " + mBatteryHelper.getCurrentBatteryLevel() + "%", Toast.LENGTH_LONG).show();
  
          // Update device stats
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_devices_list, container, false);
  
          mListener.showAd();
  
          // Obtain recycler view
          mRecyclerView = (RecyclerView) view.findViewById(R.id.devices_recycler_view);
          mRecyclerView.setHasFixedSize(true);
  
          mAdapter = new DeviceAdapter(getActivity(), mDevices);
  
          // Set adapter
          mRecyclerView.setAdapter(mAdapter);
  
          // Set layout manager
          mLayoutManager = new LinearLayoutManager(getActivity());
          mRecyclerView.setLayoutManager(mLayoutManager);
  
  
          return view;
      }
  
      @Override
      public void onAttach(Activity activity) {
          super.onAttach(activity);
          try {
              mListener = (OnFragmentInteractionListener) activity;
          } catch (ClassCastException e) {
              throw new ClassCastException(activity.toString()
                      + " must implement OnFragmentInteractionListener");
          }
      }
  
      @Override
      public void onDetach() {
          super.onDetach();
          mListener = null;
      }
  
      public List&lt;Device&gt; getDevices() {
  
          ParseQuery&lt;Device&gt; query = ParseQuery.getQuery(Device.DEVICES);
  //                new ParseQuery&lt;Device&gt;(Device.DEVICES);
          query.whereEqualTo("deviceUser", ParseUser.getCurrentUser());
          query.findInBackground(new FindCallback&lt;Device&gt;() {
              @Override
              public void done(List&lt;Device&gt; devices, ParseException e) {
                  if (e == null) {
                      // Loop through return devices
                      for (Device device : devices) {
                          Device currentDevice = new Device();
                          currentDevice.setDeviceName(device.getDeviceName());
                          currentDevice.setBatteryLevel(device.getBatteryLevel());
                          currentDevice.setIsCharging(device.isCharging());
                          mDevices.add(currentDevice);
                      }
                      mAdapter.notifyDataSetChanged();
                  } else {
                      // Something went wrong
                      Toast.makeText(getActivity(), "Error: " + e.toString(), Toast.LENGTH_LONG).show();
                  }
              }
          });
  
          return mDevices;
      }
  
      @Override
      public void onClick(View v) {
          // Click events go here
      }
  
      public static DevicesCardViewFragment newInstance(List&lt;Device&gt; mDevices) {
          DevicesCardViewFragment fragment = new DevicesCardViewFragment();
  
          Bundle args = new Bundle();
  
          return fragment;
      }
  
      public interface OnFragmentInteractionListener {
          public void showAd();
      }
  }
  </code></pre>
  
  <p>My <strong>recyclerViewAdapter</strong> looks like this:</p>
  
  <pre><code>package com.garciaericn.t2d.data;
  
  public class DeviceAdapter extends RecyclerView.Adapter&lt;DeviceAdapter.MyViewHolder&gt; {
  
      private final LayoutInflater inflater;
  
      List&lt;Device&gt; data = Collections.emptyList();
  
      public DeviceAdapter(Context context, List&lt;Device&gt; data) {
          inflater = LayoutInflater.from(context);
          this.data = data;
      }
  
      @Override
  
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = inflater.inflate(R.layout.card_layout, parent, false);
  
          MyViewHolder holder = new MyViewHolder(view);
  
          return holder;
      }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder, int position) {
  
          Device device = data.get(position);
  
          holder.deviceNameTV.setText(device.getDeviceName());
          holder.batteryLevelTV.setText(device.getBatteryLevel());
      }
  
      @Override
      public int getItemCount() {
          return 0;
      }
  
      public static class MyViewHolder extends RecyclerView.ViewHolder {
          // Temp data set
          private String[] mDataset;
  
          TextView deviceNameTV;
          TextView batteryLevelTV;
  
          public MyViewHolder(View itemView) {
              super(itemView);
              deviceNameTV = (TextView) itemView.findViewById(R.id.device_name_tv);
              batteryLevelTV = (TextView) itemView.findViewById(R.id.battery_level_tv);
          }
      }
  }
  </code></pre>