+ @Override
+ protected void onNewIntent(Intent intent) {
+ // Set `loadingNewIntentBoolean`.
+ loadingNewIntentBoolean = true;
+
+ // Sets the new intent as the activity intent, so that any future `getIntent()`s pick up this one instead of creating a new activity.
+ setIntent(intent);
+
+ if (intent.getData() != null) {
+ // Get the intent data and convert it to a string.
+ final Uri intentUriData = intent.getData();
+ formattedUrlString = intentUriData.toString();
+ }
+
+ // Close the navigation drawer if it is open.
+ if (drawerLayout.isDrawerVisible(GravityCompat.START)) {
+ drawerLayout.closeDrawer(GravityCompat.START);
+ }
+
+ // Load the website.
+ loadUrl(formattedUrlString);
+
+ // Clear the keyboard if displayed and remove the focus on the urlTextBar if it has it.
+ mainWebView.requestFocus();
+ }
+