Open yudikarma opened 5 years ago
I also need help on the same issue
Hi, Sorry for not responding sooner. Could you please explain where you're setting these arguments and where you're reading them in the fragment?
in myStepperFragment : Bundle bundle = new Bundle(); if (getArguments
This seems a bit suspicious to me i.e. why would you create a new bundle in the Fragment?
Passing the position to each fragment can be done as in the sample app: https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/adapter/StepperFeedbackFragmentStepAdapter.kt https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/step/fragment/StepperFeedbackStepFragment.kt
My question was actually this - How do i best pass data across 2 stepper fragments?
There's a sample in the sample app which you might have a look at: https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/PassDataBetweenStepsActivity.kt https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/adapter/PassDataBetweenStepsFragmentStepAdapter.kt https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/step/fragment/PassDataBetweenStepsFirstStepFragment.kt https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/step/fragment/PassDataBetweenStepsSecondStepFragment.kt
thanks for awesome third-party library :+1: i was try to send data from StepperAdapter to fragment like this :
in my stepperAdapter :
switch (position){ case 0: final SetTitleFragment setTitleFragment = new SetTitleFragment(); Bundle b1 = new Bundle(); b1.putInt(CURRENT_STEP_POSITION_KEY,position); b1.putInt("id_from_adapter",10); setTitleFragment.setArguments(b1); return (Step) setTitleFragment;
in myStepperFragment : Bundle bundle = new Bundle();
but i not get the data. the toast result just 0 or NULL
how to do ? please tell me Thanks