summaryrefslogtreecommitdiffstats
path: root/packages/CaptivePortalLogin
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2014-07-18 12:27:23 -0400
committerPaul Jensen <pauljensen@google.com>2014-07-18 16:34:57 +0000
commitb6ea9ee6fe6fc205f4f8be593ca993d594e8d504 (patch)
tree9a1fe699622e1d7b5510f45a91437d43cf807e47 /packages/CaptivePortalLogin
parent53777b58f355d09e22c1dc91702f1701a9a7fb09 (diff)
downloadframeworks_base-b6ea9ee6fe6fc205f4f8be593ca993d594e8d504.zip
frameworks_base-b6ea9ee6fe6fc205f4f8be593ca993d594e8d504.tar.gz
frameworks_base-b6ea9ee6fe6fc205f4f8be593ca993d594e8d504.tar.bz2
Make back button work in CaptivePortalLogin app like a web browser.
Users will be using the app to navigate web pages like they are used to in web browsers, so the back button should act similarly. There also isn't an in-app back button so this adds essentially necessary functionality. bug:16397616 Change-Id: Idd73d4a048d79e56bf981a8f477336f00eaafc3b
Diffstat (limited to 'packages/CaptivePortalLogin')
-rw-r--r--packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 2c1db02..09525b2 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -97,6 +97,16 @@ public class CaptivePortalLoginActivity extends Activity {
}
@Override
+ public void onBackPressed() {
+ WebView myWebView = (WebView) findViewById(R.id.webview);
+ if (myWebView.canGoBack()) {
+ myWebView.goBack();
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_use_network) {