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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user