Before i start, i have look through question such as:
Passing data between fragments: screen overlap How to pass values between Fragments
as well as Android
I would normally have setters or methods similar to this in the containing activity.
So if I understand correctly, you want the user to access RegistrationOneFragment
, then when completed, use this data, validate it, and if valid, pass it along to RegistrationTwoFragment
and move the user to this Fragment
.
Could you simply call validateJson(regData)
in your onEmailRegistered
method to handle the validation in your activity, if it succeeds, commit a transaction to RegistrationTwoFragment
.
Then all you need are getters and setters in your activity or Fragment to say getRegistrationOneData()
in the activity or setData(Registration args)
in the fragment as your examples show above.
I don't know of any way to pass the args directly into the Fragment.