我和我的队友正在同一个项目上工作
我们都使用的是Android Studio 2.3和Gradle 3.3
我在代码中使用了dataBinding,一切正常:
的gradle:
...
android {
...
dataBinding {
enabled = true
}
}
...
my_view.xml:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout>
....
</RelativeLayout>
</layout>
MyClass.java:
public class MyClass extends Toolbar {
private MyViewBinding binding;
...
@Override
protected void onFinishInflate() {
super.onFinishInflate();
initializeView();
}
private void initializeView() {
this.binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.my_view,this, true);
...
}
}
正如我所说,一切正常,但我的队友Android Studio显示此错误:android studio java.lang.RuntimeException: view tag isn't correct on view:null
请指导我们如何解决它?