Animators may only be run on Looper threads

682 views
Skip to first unread message

ales

unread,
Sep 18, 2015, 8:37:14 AM9/18/15
to macroid
Hi,
I am facing weird error meessage in Android 5.0.1 - "Animators may only be run on Looper threads". The same code works fine on Android 4, but on Android 5 it raises an mentioned exception.

There is custom checkbox tweak:

object CheckBoxTweaks {
 type W
= CheckBox

 
def checked(value: Boolean) = Tweak[W](_.setChecked(value))
}

and I use the "checked" tweak in MyActivity#onCreateView:

override def onCreateView( inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle ) = {
 val lay
= l[ScrollView](
 l
[VerticalLinearLayout](
 
...
 w
[CheckBox] <~ text( "Finished" ) <~ matchWidth <~ wire( finishedCheckBox ) <~ checked( aTask.state == Finished ) <~ On.click {
 
...
 
}
 
} )
 
)
 
)
 getUi
( lay )
}

The error is raised on the getUi(lay) line. What could be the problem, I think that the layout is run in the UI thread, isnt't it? Or is the Looper thread different from UI thread mentioned in the Macroid documentation?

Thank you for any hint.
Ales
Reply all
Reply to author
Forward
0 new messages