RuntimeException: Could not inflate Behavior subclass

≡放荡痞女 提交于 2019-12-03 11:04:15
PangoSea

Add the following two constructors to your FooterBehavior:

public FooterBehavior() {
}

public FooterBehavior(Context context, AttributeSet attrs) {
    super(context, attrs);
}
Md Imran Choudhury

If you are using AndroidX (open-source project that the Android team uses to develop, test, package, version and release libraries within Jetpack) then you need to update XML.

Find your element here and replace:

Support:

android.support.design.widget.FloatingActionButton

AndroidX:

com.google.android.material.floatingactionbutton.FloatingActionButton

Make sure that you are using the correct path of the custom behavior class.

For example:

app:layout_behavior="net.company.myapp.view.behavior.TextViewBehavior"

Aleksey Leonov

Solved. Change app:layout_behavior=".ScrollingFABBehavior"/> to app:layout_behavior=".ui.ScrollingFABBehavior"/>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!