--This is my Fragment :--
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_save, container, false);
savedAlamat = view.findViewById(R.id.saved_alamat);
savedContac = view.findViewById(R.id.saved_kontak);
savedName = view.findViewById(R.id.saved_nama);
String malamat = getArguments().getString("mAlamat");
String mcontac = getArguments().getString("mContac");
String mname = getArguments().getString("mname");
savedAlamat.setText(malamat);
savedContac.setText(mcontac);
savedName.setText(mname);
return view;
}
//and This is main acivity that constarin framelayout :
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_save, container, false);
savedAlamat = view.findViewById(R.id.saved_alamat);
savedContac = view.findViewById(R.id.saved_kontak);
savedName = view.findViewById(R.id.saved_nama);
String malamat = getArguments().getString("mAlamat");
String mcontac = getArguments().getString("mContac");
String mname = getArguments().getString("mname");
savedAlamat.setText(malamat);
savedContac.setText(mcontac);
savedName.setText(mname);
return view;
}
--I don't understand why I keep get NotNULLobject, i want to make a passing data between that activity and fragment.