public class ToDoAdapter extends RecyclerView.Adapter {
Context context;
ArrayList
Your Recyclerview is being skipped because there is no adapter attached to it when the layout is drawn. You're currently setting the adapter from an event callback which will still return after the layout is already drawn and the Recyclerview has been skipped. You need to call setAdapter()
directly in your Activity's onCreate
then update the adapter's data making sure to call notifydatasetchanged
in your event callback.
Inside your activity's onCreate:
// Create an empty adapter since you don't have initial data
// (You may need to alter the constructor of your Adapter class
// to keep it from trying to process empty/null data so it doesn't break)
MyAdapter myAdapter = new MyAdapter(null);
// Set the Recyclerview's Adapter so it isn't skipped on the layout pass
myRecyclerView.setAdapter(myAdapter);
Then, inside your event callback:
// Update your Adapter with the new data using an update function you define in your Adapter
myAdapter.updateData(myNewData);
// Notify the Adapter that the data has changed
myAdapter.notifyDataSetChanged();