Pass ArrayList object to fragment
<p>I'm having a hard time solving this issue. I'm trying to send 3 different arraylists of custom objects to a fragment from expandable list view click. Here is expandable list view code(I have only included the first group position and children, but in reality there are more):</p>

<pre><code>*/
public class MyWorkout extends BaseActivity{

ExpandableListView expandableListView;
HashMap&lt;String, List&lt;String&gt;&gt; Workouts_details;
List&lt;String&gt; Workout_list;
WorkoutsAdapter mAdapter;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.my_workout);
    mToolBar = activateToolbar();
    setUpNavigationDrawer();


    expandableListView = (ExpandableListView) findViewById(R.id.listViewWorkouts);
    Workouts_details = DataProvider.getInfo();
    Workout_list = new ArrayList&lt;&gt;(Workouts_details.keySet());
    mAdapter = new WorkoutsAdapter(this, Workouts_details, Workout_list);



    expandableListView.setAdapter(mAdapter);

    expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            if (groupPosition == 0) {
                if (childPosition == 0) {
                    Intent intent = new Intent(getApplicationContext(), WorkoutDaysActivity.class);
                    intent.putExtra("workout", "w29w1");
                    startActivity(intent);
                }
                if (childPosition == 1) {
                  Intent intent = new Intent(getApplicationContext(), WorkoutDaysActivity.class);
                    intent.putExtra("workout", "w29w1");
                    startActivity(intent);
                }
</code></pre>

<p>From there, each childClick sends the app to WorkoutDaysActivity, where 3 tabs are set up with fragments. Here is the code to this class:</p>

<pre><code>public class WorkoutDaysActivity extends BaseActivity{

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.workout_days);
    mToolBar = activateToolbar();
    setUpNavigationDrawer();


    ViewPager vp = (ViewPager) findViewById(R.id.view_pager);
    this.addPages(vp);

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
//        tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
    tabLayout.setupWithViewPager(vp);
    tabLayout.setOnTabSelectedListener(listener(vp));

}

//ADD ALL PAGES
private void addPages(ViewPager pager) {
    MyFragPagerAdapter adapter = new  MyFragPagerAdapter(getSupportFragmentManager());
    Intent intent = getIntent();
    String workout = intent.getStringExtra("workout");
    Bundle args = new Bundle();
    args.putString("workout", workout);

    MondayFragment mondayFragment = new MondayFragment();
    mondayFragment.setArguments(args);
    adapter.addPage(mondayFragment);
    WedFragment wedFragment = new WedFragment();
    wedFragment.setArguments(args);
    adapter.addPage(wedFragment);
    FridayFragment fridayFragment = new FridayFragment();
    fridayFragment.setArguments(args);
    adapter.addPage(fridayFragment);
     pager.setAdapter(adapter);
}

private TabLayout.OnTabSelectedListener listener(final ViewPager pager) {
    return new TabLayout.OnTabSelectedListener() {
        @Override
        public void onTabSelected(TabLayout.Tab tab) {
            pager.setCurrentItem(tab.getPosition());
        }

        @Override
        public void onTabUnselected(TabLayout.Tab tab) {

        }

        @Override
        public void onTabReselected(TabLayout.Tab tab) {

        }
    };
}
 }
</code></pre>

<p>Then from there, I have the 3 tab fragment classes. Each  class looks like this:</p>

<pre><code>public class WedFragment extends Fragment {

Bundle args = getArguments();
String workout3 = args.getString("workout");

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.wed_fragment, null);

//        //RECYCLERVIEW
    RecyclerView rv = (RecyclerView) view.findViewById(R.id.mRecyclerWed);
    rv.setLayoutManager(new LinearLayoutManager(this.getActivity()));
    rv.setAdapter(new MyRecyclerAdapter(this.getActivity(), getWedWorkout()));

    return view;


}

private ArrayList&lt;Workout&gt; getWedWorkout() {
    //COLLECTION OF MONDAY WORKOUT

    ArrayList&lt;Workout&gt; workout = new ArrayList&lt;&gt;();
    switch(workout3) {
        case "w29w1" : {
            Workout workouts = new Workout("Bench", "60", "6", "155", false);

            //ADD TO COLLECTION
            workout.add(workouts);

            workouts = new Workout("Bench", "70", "5", "175", false);
            workout.add(workouts);

            break;}
        case "w29w2" :{
            Workout workouts = new Workout("Squat", "60", "6", "155", false);

            //ADD TO COLLECTION
            workout.add(workouts);

            workouts = new Workout("Squat", "70", "5", "175", false);
            workout.add(workouts);

        break;}
    } return workout;



    //SINGLE EXERCISE


}

@Override
public String toString() {
    return "Wednesday";
}
}
</code></pre>

<p>EDIT: I've edited my post, this is why I was trying to do. In my mind it should work, in reality it does not. I get this error when the app tries to open the fragment and crashes:</p>

<pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bestworkouts.sheikoworkout/com.bestworkouts.sheikoworkout.WorkoutDaysActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
                                                                                at android.app.ActivityThread.access$1100(ActivityThread.java:222)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                at android.os.Looper.loop(Looper.java:158)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                             Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
                                                                                at com.bestworkouts.sheikoworkout.Fragments.WedFragment.&lt;init&gt;(WedFragment.java:24)
                                                                                at com.bestworkouts.sheikoworkout.WorkoutDaysActivity.addPages(WorkoutDaysActivity.java:47)
                                                                                at com.bestworkouts.sheikoworkout.WorkoutDaysActivity.onCreate(WorkoutDaysActivity.java:27)
                                                                                at android.app.Activity.performCreate(Activity.java:6876)
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
                                                                                at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
</code></pre>