我想将我的 utils 类之一绑定到文本视图。我在数据字段中包含了我的 Utils 类。当我运行该应用程序时,出现错误,例如未找到该方法
我的 xml 文件
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="PACKAGE_NAME.utils.CommonUtils"/>
<variable
name="viewModel"
type="PACKAGE_NAME.PACKAGE_UI_PATH.RecordItemViewModel" />
</data>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:elevation="5dp"
app:cardElevation="5dp"
tools:targetApi="lollipop">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.google.android.material.card.MaterialCardView>
</layout>
我收到以下错误消息
发现数据绑定错误。****/ 数据绑定错误 ****msg: 在类 PACKAGE_NAME.utils.CommonUtils 中找不到方法 returnDiffFromCurrentDate(java.lang.String)
德玛西亚99
相关分类