NOTE: This resembles a duplicate but none of the others solved my problem
@Hitesh Tarbundiya's answer in Step 2 solved my problem
I am using the natario1 CameraView library for android to record video.
I am working with a Fragment.
I have written code to
Stop the video recording
Save the recorded video
Update the media gallery with the newly created video file
But what I can't figure out now is where to call those methods when the user presses the back button or home button on their phone before the fragment is destroyed.
I have tried calling the methods from the onPause() onStop() onDestroyView() and onDestroy() but have not succeeded.
Would appreciate some advice, thanks.