I am using Android data binding library . I have a requirement that if the linked number is less than 10, I need to show it with an added zero (e.g. 01 , 05 ), and also show a normal number.
Here is the relevant part of my layout:
<TextView android:id="@+id/tlm_no" style="@style/BlackSmallTextStyle" android:layout_width="@dimen/study_plan_icon_width" android:layout_height="wrap_content" android:layout_below="@id/tlm_image" android:gravity="center" android:fontFamily="sans-serif-light" android:text="@{studyPlanDetailVM.studyPlanDetail.learningPlanResource[0] < 10 ? `0` + studyPlanDetailVM.studyPlanDetail.learningPlanResource[0] : studyPlanDetailVM.studyPlanDetail.learningPlanResource[0]}" />
But when I create the project, it throws the following error: The value of attribute "android:text" associated with an element type "TextView" must not contain the '<' character
How can I solve this problem?
source share