My app uses three tabs (bottom navigation), the three fragments associated to the three tabs are loaded from a fragment manager. When the app starts, it shows the first tab/fragment. I have a button on the third tab. How can I attach a handler to it ? If I try to do it from within the fragment's code, the code
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var ignored = base.OnCreateView(inflater, container, savedInstanceState);
var view = inflater.Inflate(Resource.Layout.fragment_options, null);
myButton = view.FindViewById<Button>(Resource.Id.myButton);
myButton.Click += buttonHandler;
return view;
}
Will always assigne "null" to "myButton", thus can't handle the button.