From: Soren Stoutner Date: Thu, 8 Oct 2015 22:12:39 +0000 (-0700) Subject: Add menu entry for home. X-Git-Tag: v1.0~48 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=405b0fa00eef8a6239f1f7ae6b0db06edb23ccb9;p=PrivacyBrowserAndroid.git Add menu entry for home. --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/Webview.java b/app/src/main/java/com/stoutner/privacybrowser/Webview.java index a0455bc9..a627a780 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/Webview.java +++ b/app/src/main/java/com/stoutner/privacybrowser/Webview.java @@ -16,9 +16,6 @@ import android.webkit.WebViewClient; import android.widget.EditText; import android.widget.ProgressBar; -import java.net.URL; - - public class Webview extends AppCompatActivity { static String formattedUrlString; @@ -117,8 +114,11 @@ public class Webview extends AppCompatActivity { int menuItemId = menuItem.getItemId(); final WebView mainWebView = (WebView) findViewById(R.id.mainWebView); - // Use the menu items to go forward or back. + // Sets the commands that relate to the menu entries. switch (menuItemId) { + case R.id.home: + mainWebView.loadUrl(homepage); + break; case R.id.back: mainWebView.goBack(); break; diff --git a/app/src/main/res/layout/activity_webview.xml b/app/src/main/res/layout/activity_webview.xml index 3244bb20..d214b1b4 100644 --- a/app/src/main/res/layout/activity_webview.xml +++ b/app/src/main/res/layout/activity_webview.xml @@ -11,6 +11,7 @@ android:orientation="horizontal" android:id="@+id/topBarLayout"> + // android:inputType="textUri" sets the keyboard to have a go arrow. + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1052d8f3..c51a4a26 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -3,6 +3,7 @@ Privacy Browser // Menu. + Home Back Forward