I'm working on a Xamaran.Android project and try to implement a DialogFragment. I watched this video in order to set the Popup.
Here is the code of my DialogFragment :
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
base.OnCreateView(inflater, container, savedInstanceState);
var view = inflater.Inflate(Resource.Layout.WordChooser, container, false);
SubmitButton = view.FindViewById<Button>(Resource.Id.SubmitButton);
SubmitButton.Click += SubmitButton_Click;
return view;
}
private void SubmitButton_Click(object sender, EventArgs e)
{
}
And here is my Activity caller :
private void FooButton_Click(object sender, EventArgs e)
{
var trasaction = FragmentManager.BeginTransaction();
WordChooser wordChooserDialog = new WordChooser();
wordChooserDialog.Show(trasaction, "word chooser fragment");
}
I do not know how to set value from my DialogFragment to my Activity and close the DialogFragment.
I tryed to use the second answer of this link but wasn't able to use getActivity();