cubesky
05/29/2017, 7:26 AMkotlin
val handler: Handler = object : Handler() {
override fun handleMessage(msg: Message) {
when (msg.what) {
0 -> { fab_next.show() }
}
super.handleMessage(msg)
}
}
and Android Studio told me This Handler class should be static or leaks might occur
,but kotlin doesn't have static
,So what should I do for this?louiscad
05/29/2017, 7:28 AMinner class
. In your case, you have to use a non anonyous class and use a WeakReferencelouiscad
05/29/2017, 7:29 AM