Created
June 13, 2021 08:40
-
-
Save varundwarkani/dbf41187883dc98ff5823b68225b4a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CallingFragment extends Fragment { | |
private UPIViewModel upiViewModel; | |
@Override | |
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |
super.onViewCreated(view, savedInstanceState); | |
upiViewModel = new ViewModelProvider(requireActivity()).get(UPIViewModel.class); | |
setObservers(); | |
} | |
private void setObservers() { | |
upiViewModel.canSaveData.observer(getViewLifecycleOwner(), canSaveData -> { | |
if (canSaveData) { | |
String upiID = upiViewModel.upiID.getValue(); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment