Renamed Imports
What happens when you love two classes so much that you cannot bear to be apart from either of them… but they share a name?
The Scenario: Observable
We have a few classes and interfaces named Observable
in Android app development:
java.util.Observable
android.database.Observable
android.databinding.Observable
-
io.reactivex.Observable
(for those using RxJava 2) - Perhaps ones from other libraries
(and this does not even count Kotlin’s own observable()
, which at least is all lowercase)
In most cases, we only need one of these in any given Kotlin class.
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.