I have placed three edit text in a fragment and want to get the values of the edit text in the fragment from the main activity. I tried the following code but its throwing
I think you name, age, and gender views are not initialized: try changing your onCreateView() like this
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.frag1, container);
name = (EditText) view.findViewById(R.id.your_id);
age = (EditText) view.findViewById(R.id.your_id);
gender = (EditText) view.findViewById(R.id.your_id);
return view;
}