Coding the Fragment classes to use the DataManager class
Add this highlighted code to the InsertFragment
class to update the onCreateView
method:
View v = inflater.inflate(R.layout.content_insert, container, false); final DataManager dm = new DataManager(getActivity()); Button btnInsert = v.findViewById(R.id.btnInsert); final EditText editName = v.findViewById(R.id.editName); final EditText editAge = v.findViewById(R.id.editAge); btnInsert.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dm.insert(editName.getText().toString(), editAge.getText().toString()); } }...