X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=a5713ae104f3b649e8a377aef913c325d810a38f;hb=e923db59fff5ad31f08679c84678cdfb1ca87d63;hp=23e000a6b438c99a534c99f77c76f609db2afd34;hpb=26ce53c5262abc009c31441130d4a330ba0c267a;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 23e000a6..a5713ae1 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -135,6 +135,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // `orbotStatus` is public static so it can be accessed from `OrbotProxyHelper`. It is also used in `onCreate()`. public static String orbotStatus; + // `webViewTitle` is public static so it can be accessed from `CreateHomeScreenShorcutDialog`. It is also used in `onCreate()`. + public static String webViewTitle; + // `navigatingHistory` is used in `onCreate()` and `onNavigationItemSelected()`. private boolean navigatingHistory; @@ -679,7 +682,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // Set the favorite icon when it changes. @Override public void onReceivedIcon(WebView view, Bitmap icon) { - // Save a copy of the favorite icon for use if a shortcut is added to the home screen. + // Save a copy of the favorite icon. favoriteIcon = icon; // Place the favorite icon in the appBar. @@ -687,6 +690,13 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation imageViewFavoriteIcon.setImageBitmap(Bitmap.createScaledBitmap(icon, 64, 64, true)); } + // Save a copy of the title when it changes. + @Override + public void onReceivedTitle(WebView view, String title) { + // Save a copy of the title. + webViewTitle = title; + } + // Enter full screen video @Override public void onShowCustomView(View view, CustomViewCallback callback) {