I am trying to use the & && operator in xml using Android data binding,
android:visibility="@{(bean.currentSpaceId == bean.selectedSpaceId **&&** bean.currentSpaceId > 0)? View.VISIBLE: View.GONE}"
but I got a compilation error:
Error: execution completed for task ': app: dataBindingProcessLayoutsDevDebug'. org.xml.sax.SAXParseException; systemId: file: /Users/path/app/build/intermediates/res/merged/dev/debug/layout/fragment_space.xml; lineNumber: 106; columnNumber: 89; The object name should immediately follow the "&" in the object reference.
and a red highlighting error in the android studio "unescaped and or non terminated character".
So how should I fix this?
Edit: found the answer, this character should be escaped:
'&' --> '&' '<' --> '<' '>' --> '>'
android android-databinding bindable
David Cheung May 11 '16 at 3:54 a.m. 2016-05-11 03:54
source share