I am creating a Cordova plugin based on the Android Camera2Video example http://developer.android.com/samples/Camera2Video/index.html
I have the Camera overlay showing and recording the video. However when I want to remove the view, it just shows a black screen.
Code to add the view:
Fragment fragment = Camera2VideoFragment.newInstance(cordova, callback);
cordova.getActivity().setContentView(resources.getIdentifier("activity_camera", "layout", packageName));
cordova.getActivity().getFragmentManager().beginTransaction().replace(resources.getIdentifier("container", "id", packageName), fragment).commit();
Code to remove the view:
Fragment fragment = cordova.getActivity().getFragmentManager().findFragmentById(resources.getIdentifier("container", "id", packageName));
cordova.getActivity().getFragmentManager().beginTransaction().remove(fragment).commit();
How can I remove the fragments and return to the regular WebView?
My plugin code so far is here: https://github.com/kmturley/cordova-plugin-media-custom