Reputation: 113
I want to reload a page with Kotlin when the swipe refresh button is pulled down. I cant find any tutorials on this for Kotlin. This gives me a datatype mismatch, how to do it right?
swipe_container.setOnRefreshListener { view ->
webview1.loadUrl("https://google.com/")
}
Upvotes: 0
Views: 113
Reputation: 751
Datatype mismatch could be because you're trying to pass view
inside setOnrefreshListener
.
swipe_container.setOnRefreshListener {
webview1.loadUrl("https://google.com/")
}
This should work for you, i'd also suggest to checkout this page for an example on implementing swipe refresh functionality on your page.
Upvotes: 1
Reputation: 20147
OnRefreshListener
doesn't pass a view
parameter - your code should be
swipe_container.setOnRefreshListener {
webview1.loadUrl("https://google.com/")
}
Upvotes: 2