Xamarin.Android OnActivityResult not being called inside a Fragment

前端 未结 4 407
梦毁少年i
梦毁少年i 2021-01-14 04:46

It appears as if OnActivityResult does not get called after accepting the picture taken from the camera.

Am I calling StartActivityForResult() wrong?, or is

4条回答
  •  悲&欢浪女
    2021-01-14 05:15

    Hmm.. I created a sample and it worked just fine for me. The only difference I see is that it looks like your override is not correct. It should be public override void OnActivityResult()

    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        var rootView = inflater.Inflate(Resource.Layout.MainFragment, container, false);
        var button = rootView.FindViewById

提交回复
热议问题