Thanks Shadow! Good to see you're still around after all these years! For some reason I wasn't able to send the value to the fragment as his answer indicates. I found a workaround though where I add the string to a bundle, then set the bundle as the arguments. Works good now!
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);
App is finally functional, though I have a feeling I'm using the wrong method to set the data to the fragment. Seems like a ton of data making each fragment class huge, probably would've been better to use sqlite but I couldn't figure out how to do what I need with that.
What made you start programming in android Shadow? Just as a hobby or?
I might as well ask before I do all this typing.. Will this much info crash the app? I wouldn't think so because it should only call the one case.. but it seems like there should be an easier way..
private ArrayList<Workout> getWedWorkout() {
ArrayList<Workout> workout = new ArrayList<>();
switch(workout3) {
case "w29w1" : {
Workout workouts = new Workout("Deadlift ^ Knee", "50", "3", dead50, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "60", "3", dead60, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "60", "3", dead60, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "70", "3", dead70, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "70", "3", dead70, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "75", "3", dead75, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "75", "3", dead75, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "75", "3", dead75, false);
workout.add(workouts);
workouts = new Workout("Deadlift ^ Knee", "75", "3", dead75, false);
workout.add(workouts);
workouts = new Workout("Incline Bench", "", "6", "00.0", false);
workout.add(workouts);
workouts = new Workout("Incline Bench", "", "6", "", false);
workout.add(workouts);
workouts = new Workout("Incline Bench", "", "6", "", false);
workout.add(workouts);
workouts = new Workout("Incline Bench", "", "6", "", false);
workout.add(workouts);
workouts = new Workout("Dip", "", "5", "", false);
workout.add(workouts);
workouts = new Workout("Dip", "", "5", "", false);
workout.add(workouts);
workouts = new Workout("Dip", "", "5", "", false);
workout.add(workouts);
workouts = new Workout("Dip", "", "5", "", false);
workout.add(workouts);
workouts = new Workout("Dip", "", "5", "", false);
workout.add(workouts);
workouts = new Workout("Rackpull", "55", "4", dead55, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "65", "4", dead65, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "75", "4", dead75, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "75", "4", dead75, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "85", "3", dead85, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "85", "3", dead85, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "85", "3", dead85, false);
workout.add(workouts);
workouts = new Workout("Rackpull", "85", "3", dead85, false);
workout.add(workouts);
break;}
That is just one case statement, there will be a total of about 40 possible cases.. each will include about the same amount of data, some a little less, some a little more. It is going into a recycler view. Thanks! I don't mind doing it this way, as it works, I'm just worried about the app being too large or something, I wouldn't think it would be as I'm sure other apps are much larger.. but don't want to type each item out if it won't work in the end lol.. I'm also wondering if I should be putting all this data in a separate class, then just setting the arraylist in the case, rather then adding all the info there as well, or if I should leave it in the fragment class.. not sure if it would make a difference