I am moving from frag1 to frag2, in frag1 I have 2 edit texts for first name and last name. I am also validating before going to frag2. But regardless of entering data in edit text it shows me "" value for both the edit texts. Here is the code...

```
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.signup_1st_new,container,false);
    fname = (EditText) rootView.findViewById(R.id.si_firstname);
    lname = (EditText) rootView.findViewById(R.id.si_lastname);
    firstName = fname.getText().toString();
    lastName = lname.getText().toString();

    next1 = (TextView) rootView.findViewById(R.id.next1);

    next1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if(firstName.isEmpty() || lastName.isEmpty()){
                Toast.makeText(getActivity().getApplicationContext(), "no name", Toast.LENGTH_LONG).show();
            }
            else {

                FragmentManager fragmentManager = getFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                fragmentTransaction.replace(R.id.fragment_container, secondFragment);
                fragmentTransaction.commit();
            }
        }
    });
    return rootView;
}

```