X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=50f6a2cca239d85c35f75f280371f151ca58c8be;hp=205331fddfc958cf93c6d01aa92480b7546d4658;hb=8b69108b214333167fc16cb897143005a7dfbad7;hpb=fd8eedc7aab1062da69d65514cf5d0a6fd28abad 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 205331fd..50f6a2cc 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -810,8 +810,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook String intentAction = intent.getAction(); Uri intentUriData = intent.getData(); - // Only process the URI if it contains data. If the user pressed the desktop icon after the app was already running the URI will be null. - if (intentUriData != null) { + // Determine if this is a web search. + boolean isWebSearch = ((intentAction != null) && intentAction.equals(Intent.ACTION_WEB_SEARCH)); + + // Only process the URI if it contains data or it is a web search. If the user pressed the desktop icon after the app was already running the URI will be null. + if (intentUriData != null || isWebSearch) { // Get the shared preferences. SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); @@ -828,7 +831,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook String url; // If the intent action is a web search, perform the search. - if ((intentAction != null) && intentAction.equals(Intent.ACTION_WEB_SEARCH)) { + if (isWebSearch) { // Create an encoded URL string. String encodedUrlString;