+ // Store the URL when it is changed. This enables the restoring of partially-typed URLs when tabs change.
+ urlEditText.addTextChangedListener(object : TextWatcher {
+ override fun beforeTextChanged(charSequence: CharSequence, start: Int, count: Int, after: Int) {
+ // Do nothing.
+ }
+
+ override fun onTextChanged(charSequence: CharSequence, start: Int, before: Int, count: Int) {
+ // Do nothing.
+ }
+
+ override fun afterTextChanged(editable: Editable) {
+ // Store the URL
+ currentWebView?.currentUrl = editable.toString()
+ }
+ })
+