68.10 Preparing the Main Fragment
The last remaining component to modify is the MainFragment class which needs to configure listeners on the Button views and observers on the live data objects located in the ViewModel class. Before adding this code, some preparation work needs to be performed to add some imports, variables and to obtain references to view ids. Edit the MainFragment.java file and modify it as follows:
.
.
import android.widget.EditText;
import android.widget.TextView;
import com.ebookfrenzy.roomdemo.ProductListAdapter;
.
.
public class MainFragment extends Fragment {
private MainViewModel mViewModel;
private ProductListAdapter adapter;
private TextView productId;
private EditText productName;
private EditText productQuantity;
.
.
@Override
public void...