68.11 Adding the Button Listeners
The user interface layout for the main fragment contains three buttons each of which needs to perform a specific task when clicked by user. Edit the MainFragment.java file and add the listenerSetup() method:
.
.
import android.widget.Button;
import com.ebookfrenzy.roomdemo.Product;
.
.
private void listenerSetup() {
Button addButton = getView().findViewById(R.id.addButton);
Button findButton = getView().findViewById(R.id.findButton);
Button deleteButton = getView().findViewById(R.id.deleteButton);
addButton.setOnClickListener(new View.OnClickListener() {
@Override
...