diff --git a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserControllerActivity.java b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserControllerActivity.java index 24fa3adb2..74fd599c1 100644 --- a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserControllerActivity.java +++ b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserControllerActivity.java @@ -4,7 +4,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; - import androidx.annotation.Nullable; public class BrowserControllerActivity extends Activity { @@ -24,7 +23,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); - if(intent.hasExtra("close")) { + if (intent.hasExtra("close")) { finish(); } } @@ -32,11 +31,10 @@ protected void onNewIntent(Intent intent) { @Override protected void onResume() { super.onResume(); - if(isCustomTabsOpen) { + if (isCustomTabsOpen) { isCustomTabsOpen = false; finish(); - } - else { + } else { isCustomTabsOpen = true; } } diff --git a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java index e7b31766d..25a7875a5 100644 --- a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java +++ b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java @@ -21,7 +21,7 @@ public class BrowserPlugin extends Plugin { public static void setBrowserControllerListener(BrowserControllerListener listener) { browserControllerListener = listener; - if(listener == null) { + if (listener == null) { browserControllerActivityInstance = null; } } @@ -70,11 +70,13 @@ public void open(PluginCall call) { getContext().startActivity(intent); Integer finalToolbarColor = toolbarColor; - setBrowserControllerListener(activity -> { - activity.open(implementation, url, finalToolbarColor); - browserControllerActivityInstance = activity; - call.resolve(); - }); + setBrowserControllerListener( + activity -> { + activity.open(implementation, url, finalToolbarColor); + browserControllerActivityInstance = activity; + call.resolve(); + } + ); } catch (ActivityNotFoundException ex) { Logger.error(getLogTag(), ex.getLocalizedMessage(), null); call.reject("Unable to display URL"); @@ -84,7 +86,7 @@ public void open(PluginCall call) { @PluginMethod public void close(PluginCall call) { - if(browserControllerActivityInstance != null) { + if (browserControllerActivityInstance != null) { browserControllerActivityInstance = null; Intent intent = new Intent(getContext(), BrowserControllerActivity.class); intent.putExtra("close", true);