“Causeed by: java.lang.RuntimeException: view must a tag”的实际含义是什么?
2022-09-02 23:48:28
如果知道想要什么标签,请告诉我。
Caused by: java.lang.RuntimeException: view must have a tag
__BaseActivity.java
@Override
public void setContentView(int layoutResID) {
mBinding.contentParent.removeAllViews();
DataBindingUtil.inflate(LayoutInflater.from(this), layoutResID, mBinding.contentParent, true);
super.setContentView(mBinding.getRoot());
}
__ChildActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.my_wallet);
}
错误日志
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mydev}: java.lang.RuntimeException: view must have a tag
at <more...>
Caused by: java.lang.RuntimeException: view must have a tag
at android.databinding.DataBinderMapperImpl.getDataBinder(DataBinderMapperImpl.java:121)