@@ -73,6 +73,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
7373 if (isAvailable ()) {
7474 try {
7575 this .show (url , getColor (toolbarColor ), showDefaultShareMenuItem , transition );
76+ if (options .optBoolean ("hidden" , false )) {
77+ this .hide ();
78+ }
7679 result .put ("event" , "loaded" );
7780 pluginResult = new PluginResult (PluginResult .Status .OK , result );
7881 pluginResult .setKeepCallback (true );
@@ -88,6 +91,11 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
8891 callbackContext .sendPluginResult (pluginResult );
8992 return true ;
9093 }
94+ case "hide" : {
95+ this .hide ();
96+ callbackContext .sendPluginResult (new PluginResult (PluginResult .Status .OK , true ));
97+ return true ;
98+ }
9199 case "getViewHandlerPackages" : {
92100 PluginResult pluginResult ;
93101 final JSONObject result = new JSONObject ();
@@ -166,6 +174,10 @@ private void show(String url, @ColorInt int toolbarColor, boolean showDefaultSha
166174 startCustomTabActivity (url , customTabsIntent .intent );
167175 }
168176
177+ private void hide () {
178+ cordova .getActivity ().startActivity (new Intent (cordova .getActivity (), cordova .getActivity ().getClass ()));
179+ }
180+
169181 private void addTransition (CustomTabsIntent .Builder builder , String transition ) {
170182 final String animType = "anim" ;
171183 switch (transition ){
0 commit comments