-
Notifications
You must be signed in to change notification settings - Fork 936
[Android] Back button doesn't go back a page but quits webview #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I need to check the behavior on iOS, but yes it is a bug on Android. I don't have much time to work on it, but I can review PR. |
Thanks for your quick response, I can try to fix it. Can you give me a hint how to compile flutter_webview? I'm new to flutter + dart and when I try
I couldn't figue out if I have to compile the plugin itself before, but a |
Got it working, it seems like gradle 4 doesn't work, I changed it to 3.3 and it works now. See flutter/flutter#10236 |
The back arrow in the app bar still closes the WebView for me. |
This is the correct behaviour imho @zoechi. The back arrow in the action bar indicates a back to the previous screen / activity, not a page back. For such a functionality you could add a button in the action bar (page back / forward), but I think you'd have to add the methods calls to the native webviews for that in a PR. |
@amuttsch thanks for clarification. |
@zoechi Correct |
On Android when navigating through websites I want to use the back button to go back a page. This is currently not possible, the webview will be closed. Is this intentional?
I use the example from the repository and can reproduce this behavior with the fullscreen and widget webview. I digged in the source code and it should be able to set the back button to go back in the webviews history first by setting a
setOnKeyListener
on the webview (see here).How is the behaviour on iOS? If I recall correctly, you swipe from left to right to go back a page in Safari. Is this currently possible?
For the Android part I can create a pull request to change the back button behaviour. Should it be configurable or always go back until we reach the end of the history before exiting the webview?
The text was updated successfully, but these errors were encountered: