The Objective: I\'m trying to make a notepad application. What my app does is, a button is pressed to create a new note. This pops up a fragment in which th
Just make your activity implement View.OnClickListener
and on your fragment set your activity as onClickListener
of your button.
your fragment:
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
myButton.setOnclickListener((MyActivity)getActivity));
}