Please inform me if knowing whats tag that wanted.
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);
}
ERROR logcat
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)
This happened to me due to the library's layout file (the one for which the error was flagged) having the same name as another one in the app module. Both used data binding.
Usually happens while learning about data binding in android, we usually use a main_activity.xml and then include content_main.xml but we by mistake put the
<layout
tag in content file. We need to put this<layout
and<data
tag in parent file that is used insetContentView()
Please convert the XML layout into data binding. this may cause this exception.like
I have used inflater without "attachToRoot". This error always occurs with issues related to inflater in adapter.
NO idea, but working.
this happened to me because one layout wasn't present for all resolution (it was only in layout and layout-normal).