Hi I am trying to find out how to replace a fragment by clicking on a button within a fragment.
I tried looking into this article but it did not work for me.
View view = getSupportFragmentManager().findFragmentById(R.id.fragment_container).getView();
btnGoToSignUp = view.findViewById(R.id.btnGoToSignUp);
I tried this but it comes up with the error
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.Fragment.getView()' on a null object reference