https://kotlinlang.org logo
#announcements
Title
# announcements
a

argoneus

05/21/2017, 10:03 AM
Copy code
val srl_view = view?.findViewById(R.id.refresh_servers) ?: return
val srl = srl_view as SwipeRefreshLayout
m

myanmarking

05/22/2017, 11:46 AM
argoneus: there is an extension function for that. use
view.find<RefreshLayout>(R.id.refresh_servers)
. or just access the view directly by it’s name if you are suing kotlin extensions
or this:
val sr: SwipeRefreshLayout = view?.find(R.id.viewid)
2 Views