Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6ea9ee6 authored by Paul Jensen's avatar Paul Jensen
Browse files

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
parent 53777b58
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -96,6 +96,16 @@ public class CaptivePortalLoginActivity extends Activity {
        return true;
    }

    @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();