'Xamarin Android terminate the only fragment that is created
I am doing an app, and I wanted to implement a camera functionality, I did so via a fragment, So on button click the new fragment is created and added. And once a photo is taken it gets saved to the memory, I also have a FileObserver in my original (MainActivity) which checks when the picture was taken/overridden and via that event, which is inside the MainActivity, I want to terminate the camera fragment and return to my MainActivity.
I start the fragment like this:
FragmentManager.BeginTransaction().Replace(Resource.Id.Main, CameraFragment.NewInstance()).Commit();
I was following this demo example: https://docs.microsoft.com/en-us/samples/xamarin/monodroid-samples/android50-camera2basic/
And I dont know what to call in my MainActivity to end the fragment and return to my MainActivity
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|